fix(stepfunctions): catch panics in spawned executions#658
Closed
vieiralucas with Copilot wants to merge 3 commits into
Closed
fix(stepfunctions): catch panics in spawned executions#658vieiralucas with Copilot wants to merge 3 commits into
vieiralucas with Copilot wants to merge 3 commits into
Conversation
Step Functions e2e tests have been flaking on main with ConnectionRefused mid-test inside wait_for_execution. The server process is gone by the time the client hits describe_execution, which means a panic in the async execution task was bubbling up through the outer tokio::spawn and killing the task without updating the execution record. Two fixes: 1. Wrap run_states in an inner tokio::spawn inside execute_state_machine, await the JoinHandle, and on JoinError (panic or cancel) mark the execution as States.Runtime FAILED with the panic payload. Panics now fail the one execution instead of leaking to the default handler. 2. Install a panic hook in the fakecloud server binary that routes panics through tracing::error! with file:line and the payload string. This gives CI logs a clear breadcrumb if any other codepath panics in the future. Also cleans up a latent unwrap() in validate_definition that was redundant with the preceding is_none() check (now a single ok_or_else flow). Adds an e2e regression test that runs an execution whose shape previously tripped the interpreter, then asserts the server is still reachable afterwards.
Co-authored-by: vieiralucas <7764293+vieiralucas@users.noreply.github.com>
…#614) Co-authored-by: vieiralucas <7764293+vieiralucas@users.noreply.github.com>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Copilot created this pull request from a session on behalf of
vieiralucas
April 18, 2026 16:24
View session
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.
conformancefailing due tocognito_forgot_password_flowConnectionRefused (server crash from Cognito bug fixed on main),codecov/patchalso failingcopilot/fix-merge-pr-611-614) — same Step Functions panic-catch changes as PR fix(stepfunctions): catch panics in spawned executions #611 but on top of current main (which includes the Cognito fixes)