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

Race in disconnect_kills_cursors.js

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 5.2.0
    • None
    • None
    • None
    • Fully Compatible
    • ALL
    • Service Arch 2021-11-15, Service Arch 2021-11-22
    • 149
    • 2

    Description

      In disconnect_kills_cursors.js, we open a load-balanced client to mongos and open a cursor on that client. We then disconnect that client to ensure that mongos kills the open cursor. We verify the cursor is killed by running a $currentOp aggregation here: https://github.com/mongodb/mongo/blob/cca75006b85690faa641a15dfc9940d2a2add52d/jstests/sharding/load_balancer_support/disconnect_kills_cursors.js#L87-L96 looking for the appropriate cursorId.

      However, it's possible we run this aggregation before the server-side thread that was managing the disconnected client finishes killing the cursor. We should check that the cursor is closed eventually (in an assert.soon) instead of immediately, to give the server-side thread time to cleanup the cursor. 

      Attachments

        Activity

          People

            george.wangensteen@mongodb.com George Wangensteen
            george.wangensteen@mongodb.com George Wangensteen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: