Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
None
-
None
-
Fully Compatible
-
ALL
-
Repl 2018-12-17, Repl 2019-01-14
-
45
Description
SessionCatalog::checkOutSession() waits until no one has checked it out AND no one has killed it.
opCtx->waitForConditionOrInterrupt(sri->availableCondVar, ul, [&sri]() {
|
return !sri->session.currentOperation() && !sri->session.killed();
|
});
|
While, SessionCatalog::checkOutSessionForKill only waits until no one has checked it out.
opCtx->waitForConditionOrInterrupt(
|
sri->availableCondVar, ul, [&sri]() { return !sri->session.currentOperation(); });
|
When a session checks in, the thread only notifies the next one:
sri->availableCondVar.notify_one();
|
If both a normal checkout and a checkOutForKill are waiting for the session checkin, however the normal checkout is the first in the queue, it wakes up, realizes the session is killed, and sleeps again. checkOutForKill won't have a chance to wake up. Changing the notify_one to notify_all will fix this problem.