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

Delist opCtx if sessionWorkFlow errors between dispatchWork() and acceptResponse()

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 7.0.0-rc0
    • None
    • None
    • None
    • Service Arch
    • Fully Compatible
    • ALL
    • Service Arch 2023-04-17
    • 18

    Description

      There is currently a race with shutdown in SessionWorkflow::_scheduleIteration().

      As part of _doOneIteration(), the opCtx for each scheduled workItem is created as part of dispatchWork(), and the opCtx is expected to be destroyed as part of acceptResponse(), which is called in a continuation of the above dispatchWork() call.

      However, it's possible that we shutdown after calling dispatchWork() and before acceptResponse(), which means we enter cleanupSession() before delisting the opCtx. As part of cleanup, we eventually enter killExhaust() which will create a new opCtx to issue the killCursors command. This causes a tassert to fire since we would be trying to create a new opCtx while one is already registered.

      Attachments

        Activity

          People

            jason.chan@mongodb.com Jason Chan
            jason.chan@mongodb.com Jason Chan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: