-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.4.0-rc0
-
Component/s: Networking
-
None
-
Fully Compatible
-
Platforms 2016-10-31
In at least one case (SERVER-26524), we had to add a brittle workaround because canceling a task does not guarantee that CallbackCanceled is delivered to the callback (if the task completes before cancel() is called, the actual response will be delivered instead).
I see how it's difficult to directly return whether CallbackCanceled will be delivered since the task is canceled by post()'ing to the asio::io_service::strand:
https://github.com/mongodb/mongo/blob/r3.4.0-rc0/src/mongo/executor/thread_pool_task_executor.cpp#L360 ->
https://github.com/mongodb/mongo/blob/r3.4.0-rc0/src/mongo/executor/network_interface_asio.cpp#L427 ->
https://github.com/mongodb/mongo/blob/r3.4.0-rc0/src/mongo/executor/network_interface_asio_operation.cpp#L114-L122
but perhaps a blocking version of TaskExecutor::cancel (or a flag that indicates whether it should block) could be added?
- related to
-
SERVER-26524 check if addShardHandle present in ShardingCatalogManagerImpl::_handleAddShardTaskResponse before continuing
- Closed