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

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

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.0.14
    • Affects Version/s: None
    • Component/s: Replication
    • Labels:
    • Fully Compatible
    • ALL
    • Repl 2019-11-04

      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.

            Assignee:
            judah.schvimer@mongodb.com Judah Schvimer
            Reporter:
            milkie@mongodb.com Eric Milkie
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: