[SERVER-43868] Session::TxnResources::release() can throw exceptions in destructors (4.0.x only) Created: 07/Oct/19  Updated: 29/Oct/23  Resolved: 24/Oct/19

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.0.14

Type: Bug Priority: Major - P3
Reporter: Eric Milkie Assignee: Judah Schvimer
Resolution: Fixed Votes: 0
Labels: SWCW
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-35770 Running a multi-statement transaction... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2019-11-04
Participants:
Case:

 Description   

At least in the 4.0 branch, calling txnResources->release() in a ScopeGuard is problematic, since ScopeGuard runs its guard function in destructor context. In the 4.2 branch, this code was refactored and eliminated, so this problem only exists in 4.0.
https://github.com/mongodb/mongo/blob/715e61e81664d0e7872e91679a17666d80021cbf/src/mongo/db/ops/write_ops_exec.cpp#L137

If release() throws in this context, terminate() is called and the server will shut down uncleanly.



 Comments   
Comment by Githook User [ 24/Oct/19 ]

Author:

{'username': 'judahschvimer', 'email': 'judah.schvimer@10gen.com', 'name': 'Judah Schvimer'}

Message: SERVER-43868 do not release ticket when stashing transaction resources for profiling
Branch: v4.0
https://github.com/mongodb/mongo/commit/7bc5decbfec9ee13e619ff605b81e5e0f45c7140

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