diff options
author | Suganthi Mani <suganthi.mani@mongodb.com> | 2019-01-31 02:10:28 -0500 |
---|---|---|
committer | Suganthi Mani <suganthi.mani@mongodb.com> | 2019-02-06 11:25:15 -0500 |
commit | 0b1c1f570bd5b916ef0661e376dfe4d27387d3c8 (patch) | |
tree | 6fae0276839b67f61bd321487c61bf846f21fe4b /src/mongo/db/curop_failpoint_helpers.cpp | |
parent | 29685e3b88423a503e048982d76e91727aaba8e1 (diff) | |
download | mongo-0b1c1f570bd5b916ef0661e376dfe4d27387d3c8.tar.gz |
SERVER-38519 Test transactions with new stepdown sequence.
Diffstat (limited to 'src/mongo/db/curop_failpoint_helpers.cpp')
-rw-r--r-- | src/mongo/db/curop_failpoint_helpers.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mongo/db/curop_failpoint_helpers.cpp b/src/mongo/db/curop_failpoint_helpers.cpp index fb78284f6f8..0cda54e880e 100644 --- a/src/mongo/db/curop_failpoint_helpers.cpp +++ b/src/mongo/db/curop_failpoint_helpers.cpp @@ -64,6 +64,7 @@ void CurOpFailpointHelpers::waitWhileFailPointEnabled(FailPoint* failPoint, const bool shouldCheckForInterrupt = checkForInterrupt || data["shouldCheckForInterrupt"].booleanSafe(); + const bool shouldContinueOnInterrupt = data["shouldContinueOnInterrupt"].booleanSafe(); while (MONGO_FAIL_POINT((*failPoint))) { sleepFor(Milliseconds(10)); if (whileWaiting) { @@ -72,7 +73,13 @@ void CurOpFailpointHelpers::waitWhileFailPointEnabled(FailPoint* failPoint, // Check for interrupt so that an operation can be killed while waiting for the // failpoint to be disabled, if the failpoint is configured to be interruptible. - if (shouldCheckForInterrupt) { + // + // For shouldContinueOnInterrupt, an interrupt merely allows the code to continue past + // the failpoint; it is up to the code under test to actually check for interrupt. + if (shouldContinueOnInterrupt) { + if (!opCtx->checkForInterruptNoAssert().isOK()) + break; + } else if (shouldCheckForInterrupt) { opCtx->checkForInterrupt(); } } |