Skip to content

Commit

Permalink
Task retrying if the context load failed
Browse files Browse the repository at this point in the history
  • Loading branch information
DImuthuUpe committed Nov 11, 2018
1 parent eb919bc commit 274c73f
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -347,8 +347,10 @@ public TaskResult onRun(TaskHelper helper) {
publishTaskState(TaskState.EXECUTING);
}
return onRun(helper, getTaskContext());
} catch (TaskOnFailException e) {
return onFail("Captured a task fail : " + e.getReason(), e.isCritical(), e);
} catch (Exception e) {
return onFail("Unknown error while running task " + getTaskId(), true, e);
return onFail("Unknown error while running task " + getTaskId(), false, e);
} finally {
MDC.clear();
}
Expand Down Expand Up @@ -422,7 +424,7 @@ private void loadContext() throws TaskOnFailException {

} catch (Exception e) {
logger.error("Error occurred while initializing the task " + getTaskId() + " of experiment " + getExperimentId(), e);
throw new TaskOnFailException("Error occurred while initializing the task " + getTaskId() + " of experiment " + getExperimentId(), true, e);
throw new TaskOnFailException("Error occurred while initializing the task " + getTaskId() + " of experiment " + getExperimentId(), false, e);
}
}

Expand Down

0 comments on commit 274c73f

Please sign in to comment.