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

Server automatically abort queries/commands after user-specified time limit



    • New Feature
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 2.5.4
    • Querying


      Add { $maxTimeMS: <integer> } as a query option, and add { maxTimeMS: <integer> } as a command option to all commands. Operations that exceed their time limit will be aborted, and an error will be returned to the client. A cursor.maxTimeMS() shell helper will be provided for queries.


      • An operation's "elapsed time" for the purpose of this feature will be the same as the operation's "elapsed time" as reported by the logging / profiling subsystems.
      • The abort semantics provided will be very similar to that of db.killOp():
        • Operations cannot currently be interrupted while waiting to acquire a lock (but this will be supported when SERVER-8579 is resolved).
        • Write operations are generally not interruptible once the first write occurs.
        • As a corollary, it is expected that operations which do not reach an interrupt point after exceeding the time limit will have an elapsed time longer than the time limit, and will be logged/profiled as such.
      • A query that completes in under its time limit will "roll over" its remaining time to the first getmore op (which will then "roll over" its remaining time to the second getmore op and so on, until the time limit is hit).
        • Cursors returned by successful time-limited queries will still obey the default cursor idle timeout (unless the "no cursor idle timeout" flag has been set).
      • For now, insert/update/delete will not support time-limited operations.


        Issue Links



              rassi J Rassi
              ppalka@gratka-technologie.pl ppalka
              35 Vote for this issue
              41 Start watching this issue