diff options
| author | Andrew Shuvalov <andrew.shuvalov@mongodb.com> | 2020-12-04 02:14:05 +0000 |
|---|---|---|
| committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-01-14 19:19:48 +0000 |
| commit | a102bde490e4f63a5558551f31e3c834edeb4dd6 (patch) | |
| tree | d7f379b3f531856abf4e47e48764b544d81c5937 /src/mongo/executor/task_executor.cpp | |
| parent | 97a53696eee8e88bb95d9ba6c4732ace7c0cc741 (diff) | |
| download | mongo-a102bde490e4f63a5558551f31e3c834edeb4dd6.tar.gz | |
SERVER-52903: Add an upper bound for how long a tenant migration donor can block operations
Diffstat (limited to 'src/mongo/executor/task_executor.cpp')
| -rw-r--r-- | src/mongo/executor/task_executor.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/executor/task_executor.cpp b/src/mongo/executor/task_executor.cpp index 83ee516dfc4..cf9b5df2c3b 100644 --- a/src/mongo/executor/task_executor.cpp +++ b/src/mongo/executor/task_executor.cpp @@ -36,6 +36,8 @@ namespace executor { namespace { +MONGO_FAIL_POINT_DEFINE(pauseScheduleCallWithCancelTokenUntilCanceled); + Status wrapCallbackHandleWithCancelToken( const std::shared_ptr<TaskExecutor>& executor, const StatusWith<TaskExecutor::CallbackHandle>& swCallbackHandle, @@ -83,6 +85,12 @@ ExecutorFuture<Response> wrapScheduleCallWithCancelTokenAndFuture( } }; + // Fail point to make this method to wait until the token is canceled. + if (!token.isCanceled()) { + pauseScheduleCallWithCancelTokenUntilCanceled.pauseWhileSetAndNotCanceled( + Interruptible::notInterruptible(), token); + } + auto scheduleStatus = wrapCallbackHandleWithCancelToken( executor, std::forward<ScheduleFn>(schedule)(request, std::move(signalPromiseOnCompletion), baton), |
