Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ private Future<Void> startExecution(boolean resume) {
* @return A future providing a boolean telling whether the action was performed already.
*/
public Future<Boolean> cancel() {
logger.info("[{}] Cancelling job ...", getId());
getStatus().setState(CANCELLING);

return storeStatus(null)
Expand Down Expand Up @@ -306,15 +307,15 @@ public Future<Void> updateStepStatus(String stepId, RuntimeInfo status, boolean
State existingStepState = step.getStatus().getState();

step.getStatus()
.withState(status.getState())
.withErrorCode(status.getErrorCode())
.withErrorCause(status.getErrorCause())
.withErrorMessage(status.getErrorMessage());
.withState(status.getState())
.withErrorCode(status.getErrorCode())
.withErrorCause(status.getErrorCause())
.withErrorMessage(status.getErrorMessage());

return updateStep(step, existingStepState, cancelOnFailure);
}

private Future<Void> updateStep(Step<?> step, State previousStepState, boolean cancelOnFailure) {
private Future<Void> updateStep(Step step, State previousStepState, boolean cancelOnFailure) {
//TODO: Once the state was SUCCEEDED it should not be mutable at all anymore
if (previousStepState != null && !step.getStatus().getState().isFinal() && previousStepState.isFinal())
//In case the step was already marked to have a final state, ignore any subsequent non-final updates to it
Expand Down Expand Up @@ -364,6 +365,7 @@ private Future<Void> updatePreviousAttempts(Step step) {
* @return A future providing a boolean telling whether the action was performed already.
*/
public Future<Boolean> resume() {
logger.info("[{}] Resuming job ...", getId());
if (isResumable()) {
getStatus().setState(RESUMING);
getSteps().stepStream().forEach(step -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ private void processEmrJobStateChangeEvent(JsonObject event) {
State newStepState = switch (emrJobStatus) {
case "RUNNING" -> RUNNING;
case "SUCCESS" -> SUCCEEDED;
case "CANCELLING" -> CANCELLING;
case "CANCELLED" -> CANCELLED;
case "FAILED" -> FAILED;
default -> null;
Expand Down