-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 3.1.7
-
Component/s: JavaScript
-
None
-
Fully Compatible
-
ALL
-
Platform 8 08/28/15
We have some pretty poor error reporting for interrupted $where's and map reduces. We should fix the interruption bit and accumulate stack's across threads
Something like:
Turn:
I QUERY [thread4] js thread raised js exception: JSInterpreterFailure Error: error: { "$err" : "Unknown Failure from JSInterpreter", "code" : 8 } : _getErrorWithCode@src/mongo/shell/utils.js:23:13 DBQuery.prototype.next@src/mongo/shell/query.js:271:1 DBCollection.prototype.findOne@src/mongo/shell/collection.js:212:15 ____MongoToSM_newFunction_temp@:2:13
Into:
I QUERY [thread4] js thread raised js exception: JSInterpreterFailure Error: error: { "$err" : "Interrupted by the host", "code" : 139 } : _getErrorWithCode@src/mongo/shell/utils.js:23:13 DBQuery.prototype.next@src/mongo/shell/query.js:271:1 DBCollection.prototype.findOne@src/mongo/shell/collection.js:212:15 ____MongoToSM_newFunction_temp@:2:13 ScopedThread@jstests/libs/parallelTester.js:15:9 ____MongoToSM_newFunction_temp@:4:17 ScopedThread@jstests/libs/parallelTester.js:15:9 ____MongoToSM_newFunction_temp@:4:13 ScopedThread@jstests/libs/parallelTester.js:15:9 @repro.js:3:9
For: (repro.js)
load("jstests/libs/parallelTester.js"); var x = new ScopedThread(function () { load("jstests/libs/parallelTester.js"); var y = new ScopedThread(function () { load("jstests/libs/parallelTester.js"); var z = new ScopedThread(function () { db.test.findOne({ $where : "sleep(100000);"}); }); z.start(); z.join(); }); y.start(); y.join(); }); x.start(); x.join();