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

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.0.14
    • Replication
    • Fully Compatible
    • ALL
    • Repl 2019-11-04

    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

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

              Dates

                Created:
                Updated:
                Resolved: