diff options
author | Pierlauro Sciarelli <pierlauro.sciarelli@mongodb.com> | 2020-11-12 17:22:42 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-11-12 18:09:20 +0000 |
commit | b3917c5828e89824cd76720224cd80c207fa4152 (patch) | |
tree | 59cf249d20413e4f79b773ccd47d82e71a875507 /src | |
parent | aa7f83b69a1340fa1d35a4ebaa281c17ae873170 (diff) | |
download | mongo-b3917c5828e89824cd76720224cd80c207fa4152.tar.gz |
SERVER-42632 Disable pinger threads that reach out to config server to make integration tests pass (BACKPORT-6623)
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/s/catalog/replset_dist_lock_manager.cpp | 7 | ||||
-rw-r--r-- | src/mongo/s/sharding_uptime_reporter.cpp | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/mongo/s/catalog/replset_dist_lock_manager.cpp b/src/mongo/s/catalog/replset_dist_lock_manager.cpp index 890f4b839f3..631b00d81a8 100644 --- a/src/mongo/s/catalog/replset_dist_lock_manager.cpp +++ b/src/mongo/s/catalog/replset_dist_lock_manager.cpp @@ -62,6 +62,8 @@ using std::unique_ptr; namespace { +MONGO_FAIL_POINT_DEFINE(disableReplSetDistLockManager); + // How many times to retry acquiring the lock after the first attempt fails const int kMaxNumLockAcquireRetries = 2; @@ -132,6 +134,11 @@ void ReplSetDistLockManager::doTask() { Client::initThread("replSetDistLockPinger"); while (!isShutDown()) { + if (MONGO_unlikely(disableReplSetDistLockManager.shouldFail())) { + log() << "The distributed lock ping thread is disabled for testing with processId " + << _processID << " and pingInterval " << _pingInterval; + return; + } { auto opCtx = cc().makeOperationContext(); auto pingStatus = _catalog->ping(opCtx.get(), _processID, Date_t::now()); diff --git a/src/mongo/s/sharding_uptime_reporter.cpp b/src/mongo/s/sharding_uptime_reporter.cpp index 108947a76b0..c19a057f7fa 100644 --- a/src/mongo/s/sharding_uptime_reporter.cpp +++ b/src/mongo/s/sharding_uptime_reporter.cpp @@ -41,6 +41,7 @@ #include "mongo/s/grid.h" #include "mongo/util/concurrency/idle_thread_block.h" #include "mongo/util/exit.h" +#include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" #include "mongo/util/mongoutils/str.h" #include "mongo/util/net/hostname_canonicalization.h" @@ -50,6 +51,8 @@ namespace mongo { namespace { +MONGO_FAIL_POINT_DEFINE(disableShardingUptimeReporterPeriodicThread); + const Seconds kUptimeReportInterval(10); std::string constructInstanceIdString(const std::string& hostName) { @@ -109,6 +112,10 @@ void ShardingUptimeReporter::startPeriodicThread() { const Timer upTimeTimer; while (!globalInShutdownDeprecated()) { + if (MONGO_unlikely(disableShardingUptimeReporterPeriodicThread.shouldFail())) { + log() << "The sharding uptime reporter periodic thread is disabled for testing"; + return; + } { auto opCtx = cc().makeOperationContext(); reportStatus(opCtx.get(), instanceId, hostName, upTimeTimer); |