summaryrefslogtreecommitdiff
path: root/src/mongo/db/service_entry_point_common.cpp
diff options
context:
space:
mode:
authorJason Chan <jason.chan@mongodb.com>2020-02-21 22:41:38 +0000
committerevergreen <evergreen@mongodb.com>2020-02-21 22:41:38 +0000
commitdb649073af2b6dac30b5d207ffa484f7d8cdc2b2 (patch)
treef93ea76d161cf3732eeaefefecea5a9788c22063 /src/mongo/db/service_entry_point_common.cpp
parent1315b6fdd3ade546c37364bcd4b0ba224adb7f58 (diff)
downloadmongo-db649073af2b6dac30b5d207ffa484f7d8cdc2b2.tar.gz
SERVER-44522 serverStatus metrics for awaitable isMaster
Diffstat (limited to 'src/mongo/db/service_entry_point_common.cpp')
-rw-r--r--src/mongo/db/service_entry_point_common.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/service_entry_point_common.cpp b/src/mongo/db/service_entry_point_common.cpp
index 7e1209c64de..20576ba4bd2 100644
--- a/src/mongo/db/service_entry_point_common.cpp
+++ b/src/mongo/db/service_entry_point_common.cpp
@@ -94,6 +94,8 @@
#include "mongo/rpc/metadata/tracking_metadata.h"
#include "mongo/rpc/op_msg.h"
#include "mongo/rpc/reply_builder_interface.h"
+#include "mongo/transport/ismaster_metrics.h"
+#include "mongo/transport/session.h"
#include "mongo/util/fail_point.h"
#include "mongo/util/log.h"
#include "mongo/util/scopeguard.h"
@@ -1283,6 +1285,13 @@ DbResponse receivedCommands(OperationContext* opCtx,
opCtx->setExhaust(OpMsg::isFlagSet(message, OpMsg::kExhaustSupported));
+ const auto session = opCtx->getClient()->session();
+ if (session) {
+ if (!opCtx->isExhaust() || c->getName() != "isMaster"_sd) {
+ InExhaustIsMaster::get(session.get())->setInExhaustIsMaster(false);
+ }
+ }
+
execCommandDatabase(opCtx, c, request, replyBuilder.get(), behaviors);
} catch (const DBException& ex) {
BSONObjBuilder metadataBob;