[SERVER-40384] Remove seemingly arbitrary time limits on javascript setup in group stage Created: 29/Mar/19  Updated: 29/Mar/19  Resolved: 29/Mar/19

Status: Closed
Project: Core Server
Component/s: JavaScript, Querying
Affects Version/s: 3.4.0, 3.6.0, 4.0.0
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Charlie Swanson Assignee: Charlie Swanson
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Participants:
Linked BF Score: 28

 Description   

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.



 Comments   
Comment by Charlie Swanson [ 29/Mar/19 ]

After discussing with david.storch and james.wahlin we're not going to move forward with this. It seems a little bit too risky to be worth pursuing.

Generated at Thu Feb 08 04:54:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.