diff options
Diffstat (limited to 'src/mongo/util/fail_point.cpp')
-rw-r--r-- | src/mongo/util/fail_point.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/util/fail_point.cpp b/src/mongo/util/fail_point.cpp index 75be5f48231..4ba84bee3ec 100644 --- a/src/mongo/util/fail_point.cpp +++ b/src/mongo/util/fail_point.cpp @@ -141,13 +141,18 @@ void FailPoint::disableFailPoint() { } while (expectedCurrentVal != currentVal); } -FailPoint::RetCode FailPoint::slowShouldFailOpenBlock() { +FailPoint::RetCode FailPoint::slowShouldFailOpenBlock( + stdx::function<bool(const BSONObj&)> cb) noexcept { ValType localFpInfo = _fpInfo.addAndFetch(1); if ((localFpInfo & ACTIVE_BIT) == 0) { return slowOff; } + if (cb && !cb(getData())) { + return userIgnored; + } + switch (_mode) { case alwaysOn: return slowOn; |