[SERVER-63875] Move TransactionWithRetries::runSync executor futures into details::Transaction Created: 22/Feb/22  Updated: 29/Oct/23  Resolved: 23/Feb/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Jack Mulrow Assignee: Jack Mulrow
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2022-03-07
Participants:
Linked BF Score: 133

 Description   

Currently, the transaction API's TransactionWithRetries::runSync method will create ExecutorFutures to call methods on its private member _internalTxn, which actually runs the transaction's commands. These futures don't guarantee the TransactionWithRetries will be in scope when they run though, potentially leading to errors. Instead, TransactionWithRetries shouldn't use an executor at all and leave that to the Transaction class, which is already a shared pointer and can extend its lifetime with shared_from_this().



 Comments   
Comment by Githook User [ 23/Feb/22 ]

Author:

{'name': 'Jack Mulrow', 'email': 'jack.mulrow@mongodb.com', 'username': 'jsmulrow'}

Message: SERVER-63875 Move TransactionWithRetries executor futures into Transaction
Branch: master
https://github.com/mongodb/mongo/commit/60f8a0134bd837770ee75f85b2f144226529f4f3

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