fix: race condition for SuspendException#46
Merged
maschnetwork merged 9 commits intomainfrom Feb 4, 2026
Merged
Conversation
zhongkechen
previously approved these changes
Feb 3, 2026
| // Check if this is a suspension, not a real failure | ||
| if (cause instanceof SuspendExecutionException || suspendFuture.isDone()) { | ||
| return DurableExecutionOutput.pending(); | ||
| } |
Contributor
There was a problem hiding this comment.
So this is a fix of how we handle suspend exceptions. The PR title/commit message might be confusing as it implies an issue in tests.
phipag
approved these changes
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Problem
Tests were failing intermittently on GitHub Actions but passing locally. Executions that should
return PENDING (waiting on callbacks/waits) were incorrectly returning FAILED.
Root Cause
The SDK uses SuspendExecutionException to unwind the call stack when execution should suspend.
The DurableExecutor relied on checking suspendFuture.isDone() to detect suspension, but due to a
race condition, the exception could propagate and be caught by generic exception handlers before
the future was visible as done - causing it to be treated as a failure.
This race was more likely to occur on CI runners due to different thread scheduling and slower
execution compared to local machines.
Changes
DurableExecutor.java
wrapped by CompletableFuture)
StepOperation.java