Skip to content

Conversation

@bergundy
Copy link
Member

Fix applies to this specific sequence of commands:

  • RequestCancelActivityTask
  • CancelTimer
  • CompleteWorkflowExecution

Closes #4049

- `RequestCancelActivityTask`
- `CancelTimer`
- `CompleteWorkflowExecution`
@bergundy bergundy requested a review from a team as a code owner March 13, 2023 19:11
@bergundy bergundy self-assigned this Mar 13, 2023
handler.hasBufferedEvents = handler.mutableState.HasBufferedEvents()
// In case the timer was cancelled and its TimerFired event was deleted from buffered events, attempt
// to unset hasBufferedEvents to allow the workflow to complete.
handler.hasBufferedEvents = handler.hasBufferedEvents && handler.mutableState.HasBufferedEvents()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
handler.hasBufferedEvents = handler.hasBufferedEvents && handler.mutableState.HasBufferedEvents()
if handler.hasBufferedEvents {
handler.hasBufferedEvents = handler.mutableState.HasBufferedEvents()
}

please...

@bergundy bergundy merged commit ed47a16 into temporalio:master Mar 14, 2023
@bergundy bergundy deleted the fix-activity-and-timer-cancel-then-complete branch March 14, 2023 04:06
yycptt pushed a commit that referenced this pull request Mar 24, 2023
#4050)

Fix UnhandledCommand error for workflow task completion with:

- `RequestCancelActivityTask`
- `CancelTimer`
- `CompleteWorkflowExecution`
wxing1292 pushed a commit that referenced this pull request Apr 14, 2023
#4050)

Fix UnhandledCommand error for workflow task completion with:

- `RequestCancelActivityTask`
- `CancelTimer`
- `CompleteWorkflowExecution`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sending a RequestCancelActivityTask and a CancelTimer command with the last WFT causes UnhandledCommand error

3 participants