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

Add noCursorTimeout option to command cursors

    • Type: Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      None

      The NoCursorTimeout bit in the OP_QUERY header prevents the server from closing a cursor that's idle for more than 10 minutes. Clients can set this bit if they may spend more than 10 minutes processing a batch of results.

      The "aggregate" and "parallelCollectionScan" commands should allow the client to turn off cursor timeouts, too. The current syntax for specifying a cursor returned from aggregate is:

      {
        aggregate: "collection",
        pipeline: [ ... ],
        cursor: { batchSize: 1000 }
      } 
      

      I propose adding:

      {
          cursor: { batchSize: 1000, noTimeout: true }
      }
      

      Perhaps "timeout: false" is clearer, though less consistent with the query API.

      "parallelCollectionScan" could include the option at the top level of the command spec:

      {
        parallelCollectionScan: "collection",
        numCursors: 4,
        noTimeout: true
      }
      

      Prompted by this question:

      http://stackoverflow.com/questions/24997404/cursor-not-found-when-using-parallel-scan-of-pymongo

            Assignee:
            Unassigned Unassigned
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            7 Vote for this issue
            Watchers:
            19 Start watching this issue

              Created:
              Updated:
              Resolved: