summaryrefslogtreecommitdiff
path: root/src/mongo/db/session.h
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-12-06 07:52:08 -0500
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-12-12 16:13:00 -0500
commitfb1ed31af90557a01fdabc8e09434dca401f1c02 (patch)
treef3488d2edfa832500b4949df7876b82fc0ca312a /src/mongo/db/session.h
parenta34b0ac74038a86f22de1d70c58f2f7c51c1a42a (diff)
downloadmongo-fb1ed31af90557a01fdabc8e09434dca401f1c02.tar.gz
SERVER-38224 Allow sessions to have more than one outstanding kill request
Also reverts commit e13e069902099d601c6cf64def9fc374082a629e (SERVER-38058 Make retryable_writes_direct_write_to_config_transactions.js expect ConflictingOperationInProgress) since it is no longer necessary.
Diffstat (limited to 'src/mongo/db/session.h')
-rw-r--r--src/mongo/db/session.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mongo/db/session.h b/src/mongo/db/session.h
index f7349e0d29e..ba01d6458f5 100644
--- a/src/mongo/db/session.h
+++ b/src/mongo/db/session.h
@@ -65,17 +65,17 @@ public:
OperationContext* currentOperation() const;
/**
- * Marks the session as killed and returns a 'kill token' to to be passed later on to
- * 'checkOutSessionForKill' method of the SessionCatalog in order to permit the caller to
- * execute any kill cleanup tasks and pass further on to '_markNotKilled' in order to reset the
- * kill state. Marking session as killed is an internal property only that will cause any
- * further calls to 'checkOutSession' to block until 'checkOutSessionForKill' is called and the
- * returned scoped object destroyed.
+ * Increments the number of "killers" for this session and returns a 'kill token' to to be
+ * passed later on to 'checkOutSessionForKill' method of the SessionCatalog in order to permit
+ * the caller to execute any kill cleanup tasks. This token is later on passed to
+ * '_markNotKilled' in order to decrement the number of "killers".
*
- * If the session is currently checked-out, this method will also interrupt the operation
- * context which has it checked-out.
+ * Marking session as killed is an internal property only that will cause any further calls to
+ * 'checkOutSession' to block until 'checkOutSessionForKill' is called the same number of times
+ * as 'kill' was called and the returned scoped object destroyed.
*
- * If the session is already killed throws ConflictingOperationInProgress exception.
+ * If the first killer finds the session checked-out, this method will also interrupt the
+ * operation context which has it checked-out.
*
* Must be called under the owning SessionCatalog's lock.
*/
@@ -123,8 +123,8 @@ private:
// is no operation currently running for the Session.
OperationContext* _checkoutOpCtx{nullptr};
- // Set to true if markKilled has been invoked for this session.
- bool _killRequested{false};
+ // Incremented every time 'kill' is invoked and decremented by '_markNotKilled'.
+ int _killsRequested{0};
};
} // namespace mongo