NSAmelchev opened a new pull request, #13775: URL: https://github.com/apache/ignite/pull/13775
`GridDhtColocatedLockFuture` completes 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), `undoLocks` finds nothing yet, and the mapping then registers the candidates for the completed future: `tryLock` returns `false`, 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** - `mapAsPrimary` and `cancel()` 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. - A reentry remembers the version of the lock future that created it (`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 (returns `true` later than the timeout) instead of returning `false` and leaving the key locked. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
