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

ClientCursor "totalNoTimeout" counter incorrectly includes cursors that have been cleaned up

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.8.0-rc3
    • Affects Version/s: 2.6.1, 2.6.5
    • Component/s: MapReduce
    • None
    • ALL
    • Hide

      Every time I run a simple MapReduce command like this

      db.runCommand({
          "mapReduce" : "test", 
          "map" : "function() { emit(this._id, 1)}",
          "reduce" : "function(key, values) { return Array.sum(values)}",
          "out" : {inline  :1}
          })
      

      a new open cursor is added:

      {
              "timedOut" : NumberLong(0),
              "open" : {
                      "noTimeout" : NumberLong(<cursor++>),
                      "pinned" : NumberLong(0),
                      "total" : NumberLong(0)
              }
      }
      
      Show
      Every time I run a simple MapReduce command like this db.runCommand({ "mapReduce" : "test" , "map" : " function () { emit( this ._id, 1)}" , "reduce" : " function (key, values) { return Array.sum(values)}" , "out" : {inline :1} }) a new open cursor is added: { "timedOut" : NumberLong(0), "open" : { "noTimeout" : NumberLong(<cursor++>), "pinned" : NumberLong(0), "total" : NumberLong(0) } }
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Every time I run mapReduce command a new cursor with noTimeout is added. Those cursors are never closed. On the production server I reached thousands of them. I tried with setting the timeout option somewhere, but I did not succeeded. The same issue is when I run

      db.getCollection("$cmd").findOne

      , but as far as I understood this is only a kind of alias for runCommand.

      Initially I spotted it using node.js driver, but it in command line the behaviour is the same.

      I tried to find a way to close the cursor in the documentation, but there is no mentioning that.

            Assignee:
            rassi J Rassi (Inactive)
            Reporter:
            mjaworsk Mateusz Jaworski
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: