Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-10329

Inaccurate documentation for getMore maxTimeMS option

    XMLWordPrintableJSON

Details

    Description

      Documentation for the getMore command's maxTimeMS option states:

      Optional. Specifies a time limit in milliseconds for processing operations on a cursor. If you do not specify a value for maxTimeMS, operations will not time out. A value of 0 explicitly specifies the default unbounded behavior.

      This option corresponds to the maxAwaitTimeMS option in drivers (see: DRIVERS-272 and this comment from SERVER-15815).

      I believe the second sentence is incorrect. If the driver has not specified the awaitData option for a tailable cursor, then a getMore should return immediately. If awaitData has been specified, then the server waits for a predefined amount (3.4 waits for one second according to my testing). Saying "operations will not time out" implies that the getMore may not return at all until there is new data to return, as does "default unbounded behavior" in the last sentence.

      AFAIK, specifying zero for maxTimeMS is equivalent to not providing the option at all, which would have the server's default timeout kick in. In the C driver, there is logic to avoid setting maxTimeMS on getMore if the user supplied a value of zero. I expect other drivers do the same.

      Attachments

        Activity

          People

            cory.bullinger@mongodb.com Cory Bullinger
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              1 year, 14 weeks, 1 day ago