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

Make JSThread stack traces more informative

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.8
    • 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();
      

            Assignee:
            mira.carey@mongodb.com Mira Carey
            Reporter:
            mira.carey@mongodb.com Mira Carey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: