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

Add noCursorTimeout option to command cursors

    XMLWordPrintable

    Details

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

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                7 Vote for this issue
                Watchers:
                19 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: