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

Shell doesn't close cursor when limit met

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

      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@mongodb.com Jonathan Reams
            Reporter:
            david.hows David Hows
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: