[SERVER-19935] Make JSThread stack traces more informative Created: 13/Aug/15  Updated: 19/Sep/15  Resolved: 24/Aug/15

Status: Closed
Project: Core Server
Component/s: JavaScript
Affects Version/s: 3.1.7
Fix Version/s: 3.1.8

Type: Bug Priority: Major - P3
Reporter: Mira Carey Assignee: Mira Carey
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platform 8 08/28/15
Participants:

 Description   

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();



 Comments   
Comment by Githook User [ 14/Aug/15 ]

Author:

{u'username': u'hanumantmk', u'name': u'Jason Carey', u'email': u'jcarey@argv.me'}

Message: SERVER-19935 Make JSThread stacks more informative

We have some pretty poor error reporting for interrupted $where's and
map reduces. This fixes the interruption bit and accumulates stack's
across threads.
Branch: master
https://github.com/mongodb/mongo/commit/35cb5b7a665e8dddb885ee126e08dcc8f765f378

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