diff options
Diffstat (limited to 'src/mongo/db/repl')
-rw-r--r-- | src/mongo/db/repl/replication_info.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mongo/db/repl/replication_info.cpp b/src/mongo/db/repl/replication_info.cpp index ab92c1208ae..73479822d21 100644 --- a/src/mongo/db/repl/replication_info.cpp +++ b/src/mongo/db/repl/replication_info.cpp @@ -250,7 +250,7 @@ boost::optional<Milliseconds> handleHelloFailPoint(const BSONObj& args, const BS // Sleep implementation outside the fail point handler itself to avoid the problem that // processing a fail point will block its state. -void sleepForDurationOrUntilShutdown(Milliseconds sleep) { +void sleepHelloForDurationOrUntilShutdown(Milliseconds sleep) { while (sleep > Milliseconds(0) && !globalInShutdownDeprecated()) { auto nextSleep = std::min(sleep, Milliseconds(1000)); try { @@ -259,6 +259,14 @@ void sleepForDurationOrUntilShutdown(Milliseconds sleep) { } catch (...) { break; } + bool stillEnabled = false; + MONGO_FAIL_POINT_BLOCK(waitInHello, customArgs) { + stillEnabled = true; + } + if (!stillEnabled) { + log() << "Fail point Hello was turned off"; + break; + } } } @@ -298,7 +306,7 @@ public: sleepTimeout = handleHelloFailPoint(customArgs.getData(), cmdObj); } if (MONGO_unlikely(sleepTimeout)) { - sleepForDurationOrUntilShutdown(*sleepTimeout); + sleepHelloForDurationOrUntilShutdown(*sleepTimeout); } /* currently request to arbiter is (somewhat arbitrarily) an ismaster request that is not |