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

Remove seemingly arbitrary time limits on javascript setup in group stage

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.4.0, 3.6.0, 4.0.0
    • Component/s: JavaScript, Querying
    • Labels:
      None
    • 28

      These two scope->exec() calls calls impose a 2 second limit, which seems arbitrary and unnecessary:

          try {
              _scope->exec(
                  "$reduce = " + _request.reduceCode, "group reduce init", false, true, true, 2 * 1000);
          } catch (const AssertionException& e) {
              return e.toStatus("Failed to initialize group reduce function: ");
          }
      
          try {
              _scope->exec("$arr = [];",
                           "group reduce init 2",
                           false,  // printResult
                           true,   // reportError
                           true,   // assertOnError
                           2 * 1000);
          } catch (const AssertionException& e) {
              return e.toStatus("Failed to initialize group reduce function: ");
          }
      

      The operation should be interruptible anyway and susceptible to the usual maxTimeMS enforcement. This is causing some spurious failures in our testing infrastructure.

      There may be other timeouts imposed on calls into the javascript engine in group or elsewhere that we should look into as well.

            Assignee:
            charlie.swanson@mongodb.com Charlie Swanson
            Reporter:
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: