Timeouts
Stage timeouts
Each stage is given 60 minutes to complete its work. If all work required for the stage is not completed within the time limit
then the job will fail. This timeout may be too short or too long for your particular use case.
To adjust the timeout, set the timeout property on a stage before adding it to the execution:
stage.timeout = <timeout_seconds>
:
const stage = new ReduceStage(async function reduce(keyToValues) {
// reduce logic
});
stage.timeout = 30 * 60 // 30 minutes stage timeout
execution.addStage(stage);
Worker timeouts
By default, every worker processing a map/reduce stage has a timeout of 60 minutes. This means if a worker working on a
particular stage does not send an emit within the timeout, the worker will fail. When a worker fails another available worker
is selected. If there are no workers available, the job will fail.
This timeout may be too short or too long for your particular use case.
To adjust the timeout, call the context.setWorkerTimeout(<timeout_seconds>)
function at the beginning of your stage:
execution.addStage(new ReduceStage(async function reduce(keyToValues) {
context.setWorkerTimeout(120 * 60); // two hour worker timeout
// your logic here
await context.onComplete();
}));