As part of SERVER-57432 we discovered that the class itself is using the locks in an unconventional fashion that can lead to confusion by thinking it holds a lock in MODE_IX while actually having a MODE_X lock. What's more, the underlying code requires the lock to be MODE_X.
The confusion stems from the fact it treats locks as movable entities when they are meant to only be used within scopes, releasing themselves when they leave it. The class instead obtains a lock during construction and releases it only when it goes out of scope, even though it gets called during different times for the various stages.
As a result we should cleanup the method so that it acquires the lock in each method instead of assuming a lock during the entire lifetime of the object.
- is related to
-
SERVER-70208 Revert SERVER-63833
- Closed
-
SERVER-57432 Prevent MODE_X and MODE_S locks from being yielded and reacquired
- Closed