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

maxTimeMS doesn't stop active operations

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: 2.5.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Operating System:
      ALL

      Description

      > var start = new Date()
      > var c = db.test.find({$where: function() { sleep(10000); return true; }});
      > c.maxTimeMS(1000)
      error: { "$err" : "JavaScript execution terminated", "code" : 16712 }
      > var end = new Date() - start
      > end
      10021

      Set the sleep to 10 seconds, set the timeout to 1 second. Run a timer, it only terminates after the 10 seconds are up and not the 1 second...

      Since javascript $where doesn't allow yielding, or checking for the kill signal for that operation, it runs through to the end of the execution.

      The same thing can happen with a page fault or other long running part of a query/operation.

        Attachments

          Activity

            People

            Assignee:
            rassi J Rassi
            Reporter:
            sam.weaver Sam Weaver
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: