Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-43868

Session::TxnResources::release() can throw exceptions in destructors (4.0.x only)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0.14
    • Component/s: Replication
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Repl 2019-11-04
    • 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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: