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

Shell doesn't close cursor when limit met

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 2.4.9, 2.6.9, 3.0.1, 3.1.0
    • 3.1.9
    • Shell
    • None
    • Fully Compatible
    • ALL
    • Build 9 (09/18/15)

    Description

      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)
      

      Attachments

        Issue Links

          Activity

            People

              jonathan.reams@mongodb.com Jonathan Reams
              david.hows David Hows
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: