[SERVER-51283] Add CancelationTokens to scheduleExhaustCommand APIs in TaskExecutor Created: 01/Oct/20  Updated: 29/Oct/23  Resolved: 18/Feb/21

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 5.0.0

Type: New Feature Priority: Major - P3
Reporter: Matthew Saltz (Inactive) Assignee: Tyler Seip (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Problem/Incident
causes SERVER-54679 Change from std::variant to stdx::var... Closed
Related
related to SERVER-52954 Investigate SERVER-51283 Closed
Backwards Compatibility: Fully Compatible
Sprint: Service Arch 2021-02-22
Participants:
Linked BF Score: 35
Story Points: 3

 Description   

This ticket is to add CancelationToken-accepting/future-returning versions of these two functions. Adding CancelationTokens is straightforward, but since the callback is called multiple times, it's not as straightforward to make them return futures which are signaled when they are done, which is why this ticket is separate from SERVER-50658



 Comments   
Comment by Githook User [ 18/Feb/21 ]

Author:

{'name': 'Tyler Seip', 'email': 'Tyler.Seip@mongodb.com', 'username': 'tseip-mongo'}

Message: SERVER-51283: Provide a futures API for scheduleExhaustRemoteCommand
Branch: master
https://github.com/mongodb/mongo/commit/70f68a9cf7077af529fd305fa7789ab0d26dd3d1

Comment by Matthew Saltz (Inactive) [ 22/Dec/20 ]

After investigation, I think it won't be so bad. Mostly I think we just need to signal the returned future when the moreToCome flag is set to false on a response. So the returned future will be resolved when the whole exhaust command has finished, and the CancelationToken will be used to cancel the entire exhaust command (not an individual callback).

Comment by Matthew Saltz (Inactive) [ 19/Nov/20 ]

It's unclear whether this is needed or how difficult it will be. There might be a need for a large-scale refactoring for exhaust in order fo this to be possible in which case we might want to not do it. I also don't think we'll add many new uses of these functions but I'm not sure.

Generated at Thu Feb 08 05:25:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.