Skip to content

Commit

Permalink
Improve logging WorkflowStateProcessor (#342)
Browse files Browse the repository at this point in the history
* Improve error logging in WorkflowStateProcessor
  • Loading branch information
jsyrjala authored and gmokki committed Oct 8, 2019
1 parent 6441844 commit e282ba0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
- Gradle 5.5.1
- New REST-API endpoint to wake up workflow instance sleeping in specified states
PUT /nflow/api/v1/workflow-instance/5/wakeup
- Improve error logging in WorkflowStateProcessor

## 5.7.0 (2019-06-06)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import static io.nflow.engine.workflow.instance.WorkflowInstance.WorkflowInstanceStatus.inProgress;
import static io.nflow.engine.workflow.instance.WorkflowInstanceAction.WorkflowActionType.stateExecution;
import static io.nflow.engine.workflow.instance.WorkflowInstanceAction.WorkflowActionType.stateExecutionFailed;
import static java.lang.String.format;
import static java.lang.Thread.currentThread;
import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
Expand Down Expand Up @@ -228,11 +229,12 @@ private WorkflowInstance saveWorkflowInstanceState(StateExecutionImpl execution,
try {
return persistWorkflowInstanceState(execution, instance.stateVariables, actionBuilder, instanceBuilder);
} catch (Exception ex) {
logger.error("Failed to save workflow instance new state, retrying after {} seconds", stateSaveRetryDelay, ex);
logger.error("Failed to save workflow instance {} new state, retrying after {} seconds",
instance.id, stateSaveRetryDelay, ex);
sleepIgnoreInterrupted(stateSaveRetryDelay);
}
} while (internalRetryEnabled);
throw new IllegalStateException("Failed to save workflow instance new state");
throw new IllegalStateException(format("Failed to save workflow instance %s new state", instance.id));
}

/**
Expand Down

0 comments on commit e282ba0

Please sign in to comment.