-
Notifications
You must be signed in to change notification settings - Fork 177
Add getLastFailure method to Workflow API #260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
temporal-sdk/src/test/java/io/temporal/workflow/WorkflowTest.java
Outdated
Show resolved
Hide resolved
temporal-sdk/src/main/java/io/temporal/internal/testservice/StateMachines.java
Outdated
Show resolved
Hide resolved
temporal-sdk/src/main/java/io/temporal/internal/testservice/TestWorkflowMutableStateImpl.java
Outdated
Show resolved
Hide resolved
temporal-sdk/src/main/java/io/temporal/internal/testservice/TestWorkflowService.java
Outdated
Show resolved
Hide resolved
temporal-sdk/src/main/java/io/temporal/internal/testservice/StateMachines.java
Outdated
Show resolved
Hide resolved
temporal-sdk/src/main/java/io/temporal/internal/testservice/TestWorkflowMutableStateImpl.java
Show resolved
Hide resolved
temporal-sdk/src/test/java/io/temporal/workflow/WorkflowTest.java
Outdated
Show resolved
Hide resolved
temporal-sdk/src/main/java/io/temporal/internal/testservice/StateMachines.java
Outdated
Show resolved
Hide resolved
temporal-sdk/src/main/java/io/temporal/internal/testservice/TestWorkflowMutableStateImpl.java
Outdated
Show resolved
Hide resolved
} | ||
} | ||
Optional<TestServiceRetryState> retryState; | ||
Optional<Failure> lastFailure = Optional.empty(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move empty() initialization to else block:
Optional<Failure> lastFailure;
if (...) {
lastFailure = ...
} else {
lastFailure = Optional.empty();
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would require us to set it to empty in two branching paths to ensure it's non-null, thus more verbose. Any particular reason not to leave it this way?
temporal-sdk/src/main/java/io/temporal/internal/testservice/TestWorkflowMutableStateImpl.java
Outdated
Show resolved
Hide resolved
temporal-sdk/src/main/java/io/temporal/internal/testservice/StateMachines.java
Outdated
Show resolved
Hide resolved
Earlier you asked about time skipping logic. It is encapsulated in the SelfAdvancingTime. |
temporal-sdk/src/main/java/io/temporal/internal/sync/SyncWorkflow.java
Outdated
Show resolved
Hide resolved
data, | ||
data.lastCompletionResult, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit. I know you haven't changed this, but do we really need to pass both data and data.lastCompletionResult separately?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do - at a different call site the last completion result comes from another source.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments, otherwise LGTM.
First PR so please fill me in on anything I'm missing arch or style wise. Thanks!
Closes #257