[SERVER-40554] The `txn::sendPrepare` utility can return without having destroyed its child AsyncWorkScheduler Created: 09/Apr/19 Updated: 29/Oct/23 Resolved: 15/Apr/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 4.1.11 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kaloian Manassiev | Assignee: | Kaloian Manassiev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Operating System: | ALL | ||||
| Sprint: | Sharding 2019-04-22 | ||||
| Participants: | |||||
| Linked BF Score: | 12 | ||||
| Description |
|
The Transaction Coordinator's txn::sendPrepare utility instantiates its own child AsyncWorkScheduler in order to be able to cancel just its part of the work without impacting the parent. The lifetime of this child scheduler has to be shorter than the signaling of the future returned by txn::sendPrepare, so that the caller can use the signaling of the future for controlling the lifetime of its own objects (in this case the entire TransactionCoordinator). The way it is currently implemented, because prepareScheduler is moved into txn::collect's collector lambda, it will still be alive at the time when the returned future's chain is signaled. |
| Comments |
| Comment by Githook User [ 15/Apr/19 ] |
|
Author: {'email': 'kaloian.manassiev@mongodb.com', 'name': 'Kaloian Manassiev', 'username': 'kaloianm'}Message: And also bound the lifetime of `prepareScheduler` to only until the |