diff options
-rw-r--r-- | jstests/noPassthrough/serverStatus_does_not_block_on_RSTL.js | 3 | ||||
-rw-r--r-- | src/mongo/watchdog/watchdog_mongod.cpp | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/jstests/noPassthrough/serverStatus_does_not_block_on_RSTL.js b/jstests/noPassthrough/serverStatus_does_not_block_on_RSTL.js index 72d6217467e..ee74b4ddf3a 100644 --- a/jstests/noPassthrough/serverStatus_does_not_block_on_RSTL.js +++ b/jstests/noPassthrough/serverStatus_does_not_block_on_RSTL.js @@ -57,8 +57,7 @@ try { resourceConsumption: 1, sharding: 1, tenantMigrationAccessBlocker: 1, - // TODO: uncomment this when SERVER-63271 gets fixed. - // watchdog: 1, + watchdog: 1, maxTimeMS: 20 * 1000 })); jsTestLog("ServerStatus results: " + tojson(serverStatusResult)); diff --git a/src/mongo/watchdog/watchdog_mongod.cpp b/src/mongo/watchdog/watchdog_mongod.cpp index 2c7d96075c0..07ad1c93f5e 100644 --- a/src/mongo/watchdog/watchdog_mongod.cpp +++ b/src/mongo/watchdog/watchdog_mongod.cpp @@ -116,9 +116,13 @@ public: } BSONObj generateSection(OperationContext* opCtx, const BSONElement& configElement) const { - BSONObjBuilder result; + if (!watchdogEnabled) { + return BSONObj(); + } + BSONObjBuilder result; WatchdogMonitor* watchdog = getWatchdogMonitor(opCtx->getServiceContext()).get(); + invariant(watchdog); result.append("checkGeneration", watchdog->getCheckGeneration()); result.append("monitorGeneration", watchdog->getMonitorGeneration()); |