Shell doesn't close cursor when limit met

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 3.1.9
    • Affects Version/s: 2.4.9, 2.6.9, 3.0.1, 3.1.0
    • Component/s: Shell
    • None
    • Fully Compatible
    • ALL
    • Build 9 (09/18/15)
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      If you issue a query with a limit via the shell, the cursor created is left open on the server and is unable to be closed.

      This is limited to the shell, as all drivers will issue a killCursors when the limit has been met.

      t = db.cursor_test;
      t.drop();
      pre = db.serverStatus().cursors.totalOpen;
      
      for ( i=1; i<=50; i++){
          t.save( { a : i } );
      }
      t.find().limit(3);
      
      assert.eq(pre,db.serverStatus().cursors.totalOpen)
      

              Assignee:
              Jonathan Reams
              Reporter:
              David Hows (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: