Skip to content

v3: fix dependency checkpoint race #1171

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

Merged
merged 3 commits into from
Jun 20, 2024
Merged

v3: fix dependency checkpoint race #1171

merged 3 commits into from
Jun 20, 2024

Conversation

nicktrn
Copy link
Collaborator

@nicktrn nicktrn commented Jun 20, 2024

This affects Task.triggerAndWait() and Task.batchTriggerAndWait(). A race condition could result where the dependency completes just before the checkpoint does.

If the timing is just right, the created checkpoint causes the resume message from dependency completion to be ACKed. This means the parent task stays stuck in the frozen state. Another issues is that even if the resume comes through, there's won't be a running task to send it to, as checkpoint completion also results in parent task termination.

The fix involves checking for dependency completion after creating the checkpoint event, and only ACKing if the dependency hasn't completed yet. Also, if the dependency has completed, we will keep the parent task alive so it can resume immediately.

Copy link

changeset-bot bot commented Jun 20, 2024

🦋 Changeset detected

Latest commit: bafe146

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@nicktrn nicktrn merged commit 55d1f8c into main Jun 20, 2024
2 checks passed
@nicktrn nicktrn deleted the v3/fix-checkpoint-race branch June 20, 2024 09:10
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.

1 participant