diff options
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/s/transaction_coordinator_futures_util.h | 2 | ||||
-rw-r--r-- | src/mongo/rpc/factory.cpp | 2 | ||||
-rw-r--r-- | src/mongo/rpc/op_msg.h | 4 |
3 files changed, 6 insertions, 2 deletions
diff --git a/src/mongo/db/s/transaction_coordinator_futures_util.h b/src/mongo/db/s/transaction_coordinator_futures_util.h index c7361906c2c..1b403d4704d 100644 --- a/src/mongo/db/s/transaction_coordinator_futures_util.h +++ b/src/mongo/db/s/transaction_coordinator_futures_util.h @@ -89,7 +89,7 @@ public: _activeOpContexts.begin(), tc->makeOperationContext()); ul.unlock(); - auto scopedGuard = makeGuard([&] { + ON_BLOCK_EXIT([&] { ul.lock(); _activeOpContexts.erase(uniqueOpCtxIter); // There is no need to call _notifyAllTasksComplete here, because we diff --git a/src/mongo/rpc/factory.cpp b/src/mongo/rpc/factory.cpp index 64bc5372142..475bcc6191e 100644 --- a/src/mongo/rpc/factory.cpp +++ b/src/mongo/rpc/factory.cpp @@ -71,7 +71,7 @@ std::unique_ptr<ReplyInterface> makeReply(const Message* unownedMessage) { OpMsgRequest opMsgRequestFromAnyProtocol(const Message& unownedMessage) { switch (unownedMessage.operation()) { case mongo::dbMsg: - return OpMsgRequest::parse(unownedMessage); + return OpMsgRequest::parseOwned(unownedMessage); case mongo::dbQuery: return opMsgRequestFromLegacyRequest(unownedMessage); default: diff --git a/src/mongo/rpc/op_msg.h b/src/mongo/rpc/op_msg.h index 86bfa8d130e..5983ed63226 100644 --- a/src/mongo/rpc/op_msg.h +++ b/src/mongo/rpc/op_msg.h @@ -123,6 +123,10 @@ struct OpMsgRequest : public OpMsg { return OpMsgRequest(OpMsg::parse(message)); } + static OpMsgRequest parseOwned(const Message& message) { + return OpMsgRequest(OpMsg::parseOwned(message)); + } + static OpMsgRequest fromDBAndBody(StringData db, BSONObj body, const BSONObj& extraFields = {}) { |