Skip to content
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

Reset lastHandledEventId on speculative WFT #1881

Merged
merged 1 commit into from
Oct 10, 2023

Conversation

Quinn-With-Two-Ns
Copy link
Contributor

On a rejected speculative WFT we also need to reset lastHandledEventId so we don't accidentally skip new workflow tasks.

  public void handleEvent(HistoryEvent event, boolean hasNextEvent) {
    long eventId = event.getEventId();
    if (eventId <= lastHandledEventId) {
      // already handled
      return;
    }
...

We also should delete any new state machines created by the speculative task

closes #1880

@Quinn-With-Two-Ns Quinn-With-Two-Ns marked this pull request as ready for review October 4, 2023 17:53
@Quinn-With-Two-Ns Quinn-With-Two-Ns requested a review from a team as a code owner October 4, 2023 17:53
Copy link
Member

@cretz cretz left a comment

Choose a reason for hiding this comment

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

I have no insight in the correctness/danger of this change and can only hope tests catch any issues. I will defer this review to others (if there are any others)

@Quinn-With-Two-Ns Quinn-With-Two-Ns merged commit 2475838 into temporalio:master Oct 10, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Speculative workflow task can cause WFT failure
3 participants