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

Using maxTimeMS & Javascript can lead to different errors from the server

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Duplicate
    • 2.5.5
    • None
    • JavaScript, Write Ops
    • ALL
    • Hide

      In the shell:

      var t = db.max_time_ms;
      t.drop();
      t.insert([{},{},{}]);
      t.getDB().adminCommand({configureFailPoint: "maxTimeAlwaysTimeOut", mode: "off"}).ok;
       
      cursor = t.find({$where: function() { sleep(100); return true; }}).maxTimeMS(100);
      // Returns
      error: { "$err" : "JavaScript execution terminated", "code" : 16712 }
       
      // Turn on a fail point
      t.getDB().adminCommand({configureFailPoint: "maxTimeAlwaysTimeOut", mode: "alwaysOn"}).ok;
      cursor = t.find({$where: function() { sleep(100); return true; }}).maxTimeMS(100);
      // Returns
      error: { "$err" : "operation exceeded time limit", "code" : 50 }

      Show
      In the shell: var t = db.max_time_ms; t.drop(); t.insert([{},{},{}]); t.getDB().adminCommand({configureFailPoint: "maxTimeAlwaysTimeOut", mode: "off"}).ok;   cursor = t.find({$where: function() { sleep(100); return true; }}).maxTimeMS(100); // Returns error: { "$err" : "JavaScript execution terminated", "code" : 16712 }   // Turn on a fail point t.getDB().adminCommand({configureFailPoint: "maxTimeAlwaysTimeOut", mode: "alwaysOn"}).ok; cursor = t.find({$where: function() { sleep(100); return true; }}).maxTimeMS(100); // Returns error: { "$err" : "operation exceeded time limit", "code" : 50 }

    Description

      Using maxTimeMS with $where returns:

      { "$err" : "JavaScript execution terminated", "code" : 16712 } 

      expected

       { "$err" : "operation exceeded time limit", "code" : 50 }

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ross@mongodb.com Ross Lawley
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: