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

timeouts in WhereMatchExpression don't give timeout errors

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • ALL
    • Dev Tools 2019-07-15
    • 37

      When a match expression takes longer than the hard coded 60 second limit, a "JavaScript execution interrupted" is returned instead of some timeout result.

      [gabriel@earthshaker master]$ ./mongo --eval 'db.foo.find({ $where : function() { sleep(61000);return(true); } })'                                                                                                                                                                         
      MongoDB shell version v0.0.0
      connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
      2019-06-25T12:54:22.470-0400 I  NETWORK  [listener] connection accepted from 127.0.0.1:60930 #1 (1 connection now open)
      2019-06-25T12:54:22.473-0400 I  NETWORK  [conn1] received client metadata from 127.0.0.1:60930 conn1: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "0.0.0" }, os: { type: "Linux", name: "Fedora release 29 (Twenty Nine)", architecture: "x86_64", version: "Kernel 5.0.16-200.fc29.x86_64" } }
      Implicit session: session { "id" : UUID("2cfe7156-05c9-4f3a-82ae-30d64b0a803f") }
      MongoDB server version: 0.0.0
      2019-06-25T12:54:22.555-0400 I  SHARDING [conn1] Marking collection test.foo as collection version: <unsharded>
      2019-06-25T12:54:22.965-0400 I  SHARDING [conn1] Marking collection test.system.js as collection version: <unsharded>
      2019-06-25T12:55:23.460-0400 E  QUERY    [js] JavaScript execution interrupted
      2019-06-25T12:55:23.499-0400 I  COMMAND  [conn1] command test.foo appName: "MongoDB Shell" command: find { find: "foo", filter: { $where: function() { sleep(61000);return(true); } }, lsid: { id: UUID("2cfe7156-05c9-4f3a-82ae-30d64b0a803f") }, $db: "test" } planSummary: COLLSCAN numYields:0 queryHash:864B2828 planCacheKey:864B2828 ok:0 errMsg:"JavaScript execution interrupted" errName:Interrupted errCode:11601 reslen:119 locks:{ ReplicationStateTransition: { acquireCount: { w: 3 } }, Global: { acquireCount: { r: 3 } }, Database: { acquireCount: { r: 3 } }, Collection: { acquireCount: { r: 5 } }, Mutex: { acquireCount: { r: 3 } } } storage:{} protocol:op_msg 60943ms
      Error: error: {
              "ok" : 0,
              "errmsg" : "JavaScript execution interrupted",
              "code" : 11601,
              "codeName" : "Interrupted"
      }
      2019-06-25T12:55:23.521-0400 I  NETWORK  [conn1] end connection 127.0.0.1:60930 (0 connections now open)
      

            Assignee:
            gabriel.russell@mongodb.com Gabriel Russell (Inactive)
            Reporter:
            gabriel.russell@mongodb.com Gabriel Russell (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: