[SERVER-12764] Using maxTimeMS & Javascript can lead to different errors from the server Created: 18/Feb/14  Updated: 10/Dec/14  Resolved: 23/Feb/14

Status: Closed
Project: Core Server
Component/s: JavaScript, Write Ops
Affects Version/s: 2.5.5
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Ross Lawley Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-11094 Javascript interruption should use se... Closed
Related
Operating System: ALL
Steps To Reproduce:

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 }

Participants:

 Description   

Using maxTimeMS with $where returns:

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

expected

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



 Comments   
Comment by J Rassi [ 23/Feb/14 ]

Resolving as dup of SERVER-11094.

Comment by Ross Lawley [ 19/Feb/14 ]

Also, happens when doing a map reduce, that exceeds maxTimeMS

{ "serverUsed" : "localhost:27017" , "errmsg" : "exception: JavaScript execution terminated" , "code" : 16711 , "ok" : 0.0}

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