Repository navigation
IGNITE-29233 Fix explicit lock left acquired when its timeout expires during mapping - #13775
Open
NSAmelchev wants to merge 2 commits into
Open
NSAmelchev wants to merge 2 commits into
NSAmelchev wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GridDhtColocatedLockFuturecompletes a timed out future without synchronizing with the mapping thread. If the timeout expires while the keys are still being mapped on the local primary node (a GC pause longer than the timeout is enough),undoLocksfinds nothing yet, and the mapping then registers the candidates for the completed future:tryLockreturnsfalse, but the key stays locked with no owner thread, the thread's next lock of the key passes as a reentry of the leaked candidate, and the next partition map exchange waits for the span forever.Changes
mapAsPrimaryandcancel()of an explicit lock are serialized with the timeout callback on the timeout object monitor: a completed future registers nothing, everything registered before is undone by the completion. Transactions release their candidates on rollback and are not affected.GridCacheMvccCandidate#reentryVer), so the rollback of a failed future removes its reentry instead of leaving it in the span.Visible behavior:
tryLock(timeout)paused during mapping longer than the timeout now acquires the lock if the key is free (returnstruelater than the timeout) instead of returningfalseand leaving the key locked.