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

profile_getmore.js does not tolerate killCursors command

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.4.10, 3.6.0-rc0
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • Fully Compatible
    • ALL
    • v3.4
    • Query 2017-10-23
    • 0

      The profile_getmore.js test creates a cursor and assigns its client-side DBQuery representation to a variable called cursor:

      https://github.com/mongodb/mongo/blob/f64d3147b938c9dcbd24ff127d5506a029902549/jstests/core/profile_getmore.js#L64

      It then leaves this cursor open on the server, while the client assigns a second DBQuery object to the cursor variable:

      https://github.com/mongodb/mongo/blob/f64d3147b938c9dcbd24ff127d5506a029902549/jstests/core/profile_getmore.js#L81

      The abandoned cursor, however, may now be garbage collected by the shell at any time. When a DBQuery is garbage collected, it issues a killCursors command to the server in order to clean up any server-side state. Therefore, after line 81, a killCursors command may at any arbitrary point during the test's execution be issued against the database under test. The test's assertions are not prepared to handle such a command appearing in the system.profile entry. We must fix the test to either

      1. tolerate the possibility of a killCursors command, or
      2. be careful to close the cursor before abandoning it.

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: