Skip to content

Commit 6279655

Browse files
mchrzaroegi
authored andcommitted
DS-2252: LambdaBasedStep - Unregister StateCheckTrigger if StateMachine is not running/existing anymore.
Signed-off-by: mchrza <maximilian.chrzan@here.com>
1 parent 3896d45 commit 6279655

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

xyz-jobs/xyz-job-steps/src/main/java/com/here/xyz/jobs/steps/execution/LambdaBasedStep.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,16 +279,14 @@ private void checkAsyncExecutionState() {
279279
logger.warn("Unknown execution state for step {}", getGlobalStepId(), e);
280280

281281
//Check if the StateMachine is still existing and if it is RUNNING. If not - unregister StateCheckTrigger.
282-
ExecutionStatus sfnExecutionStatus;
283282
try {
284-
sfnExecutionStatus = SFNInspector.getSFNExecutionStatus(executionId);
283+
ExecutionStatus sfnExecutionStatus = SFNInspector.getSFNExecutionStatus(executionId);
284+
if(sfnExecutionStatus != ExecutionStatus.RUNNING)
285+
unregisterStateCheckTrigger();
285286
}catch (ExecutionDoesNotExistException e1){
286287
logger.info("[{}] StateMachine already gone ...", getGlobalStepId());
287-
sfnExecutionStatus = ExecutionStatus.FAILED;
288-
}
289-
290-
if(sfnExecutionStatus != ExecutionStatus.RUNNING)
291288
unregisterStateCheckTrigger();
289+
}
292290

293291
synchronizeStep();
294292
//NOTE: No heartbeat must be sent to SFN in this case!

0 commit comments

Comments
 (0)