-
Type: Task
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Internal Code
-
None
-
Sharding 2020-10-19
Currently, TaskExecutor only has a scheduleRemoteCommand interface that takes a callback and returns a callback handle.
As we are structuring more code as a future chain that runs on an executor with a limited number of threads (particularly Primary-Only Service instances), it will be very helpful to have a version of scheduleRemoteCommand that returns a Future.
This, combined with the generic whenAll/whenAny/collect utilities described in SERVER-50341, would be very useful in writing a Primary-Only Service which has steps that send a command to many remote nodes and wait for all of their responses.
Note that SERVER-50342, which is to add a version of Shard::runCommand that returns a Future, would help in sharding code, but would not help for code that runs in standalone replica sets, such as the Primary-Only Services being built for Multitenant Migrations for Serverless (PM-1791).
While this is not an immediately blocking work on PM-1791, since we can work around it by blocking the thread on the executor while waiting for a network response, it does block releasing PM-1791.
- duplicates
-
SERVER-50658 Add support for CancelationTokens to TaskExecutor::scheduleRemoteCommand
- Closed
- is related to
-
SERVER-50342 Make version of Shard::runCommand that returns a future
- Open
-
SERVER-50341 Make generic whenAll, whenAny, collect utilities for futures
- Closed