-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Internal Code
-
None
-
Fully Compatible
-
ALL
-
Query Execution 2021-07-26, QE 2021-08-09
-
138
SERVER-29794 added _comment as a new member of OperationContext, and exposed setComment()/getComment() to set/get the value of the new field.
Accessing _comment, however, is not thread-safe, and to ensure thread-safety:
- The client lock must be acquired before calling into setComment().
- The client lock must be acquired to getComment() from any thread that does not own the client associated with the operation (i.e., Client::getCurrent() != opCtx->getClient()).
The common practice is to use the client lock to serialize concurrent accesses to OperationContext fields that are not thread-safe. We currently do so to access _comment when preparing the currentOp output (see here).
- is caused by
-
SERVER-29794 Adding a comment to all commands
- Closed