[SERVER-41911] timeouts in WhereMatchExpression don't give timeout errors Created: 25/Jun/19  Updated: 27/Oct/23  Resolved: 02/Jul/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Gabriel Russell (Inactive) Assignee: Gabriel Russell (Inactive)
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Operating System: ALL
Sprint: Dev Tools 2019-07-15
Participants:
Linked BF Score: 37

 Description   

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)



 Comments   
Comment by Gabriel Russell (Inactive) [ 02/Jul/19 ]

After further discussion with Jason Carey, this should be left as is. We don't want to return the same error for the two different timeouts, and there is no piratical value is creating a new different timeout error.

Generated at Thu Feb 08 04:59:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.