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

Allow external clients to set maxTimeMSOpOnly

    • Type: Icon: New Feature New Feature
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Query Execution
    • Service Arch 2022-05-30, Service Arch 2022-06-13

      In DRIVERS-555 we use maxTimeMS on every command in to impose a time limit on operations. This allows drivers to reuse connections after the timeout expires. One problem is that maxTimeMS for find/aggregate/getMore commands does not work the same as maxTimeMS on every other command. This means that the driver can't set a proper timeout for a cursor getMore. Instead, we send the getMore to the server without the maxTimeMS field and then use the connection timeout to cancel the request. This is unfortunate because a connection timeout means the connection needs to be closed.

      A useful improvement would be for the server to support a maxTimeMS mechanism for find/aggregate/getMore which works identically to maxTimeMS for all other commands. To preserve backwards compatibility (at least for getMore, and possibly for find/aggregate as well), we would need to introduce a new field (maybe "maxTimeoutMS").

      Edit: max.hirschhorn pointed out that this feature already exists but is internal only:

      The maxTimeMSOpOnly option was introduced by SERVER-47117 as part of the hedged reads project (added in MongoDB 4.4) . However, it looks like the server forbids external clients (i.e. drivers) from specifying the maxTimeMSOpOnly option.

      I would like to request that the server allow external clients set maxTimeMSOpOnly so that we can have consistent behavior for find/aggregate/getMore commands.

            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            shane.harvey@mongodb.com Shane Harvey
            0 Vote for this issue
            15 Start watching this issue