Skip to content
Merged
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 @@ -3172,13 +3172,16 @@ public UpdateWorkflowExecutionLifecycleStage waitForStage(
}

public UpdateWorkflowExecutionLifecycleStage getStage() {
if (!accepted.isDone()) {
return UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_ADMITTED;
} else if (!outcome.isDone()) {
// A resolved outcome is terminal (a success result or a rejection/failure), so it always

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: comment formatting is weird

// means COMPLETED. Checking it first keeps stage derivation independent of the order in
// which the `accepted` and `outcome` futures complete. The `accepted` future only
// distinguishes ADMITTED from ACCEPTED.
if (outcome.isDone()) {
return UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_COMPLETED;
} else if (accepted.isDone()) {
return UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_ACCEPTED;
}
return UpdateWorkflowExecutionLifecycleStage
.UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_COMPLETED;
return UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_ADMITTED;
}

public String getId() {
Expand Down
Loading