Repository navigation
fix(core): retry cancelled asynchronous actions after resume - #1032
Open
linhongyu510 wants to merge 1 commit into
Open
linhongyu510 wants to merge 1 commit into
linhongyu510 wants to merge 1 commit into
Conversation
7 tasks done
This branch has not been deployed
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.
Cancelling an ordinary asynchronous action currently records its step as
completed, even though its state update never ran. Rebuilding the application withresume_at_next_action=Truethen skips that action and advances to its successor. For example, cancellingworkwhile it waits for a response resumes atafterwith the old state.Changes
asyncio.CancelledErrorfor_astep'spost_run_stephooks before re-raising it. Persisters consequently record the step asfailedand resume at the interrupted action.astepandarun, with both function-based single-step actions and class-based multi-step actions. The tests cancel at an event-controlled await, rebuild from persisted state, retry, and verify the final result.How I tested this
36e3ff3048c8cabd7aac6d5c373307934bf3c2df, all four new cases fail because the next action after recovery isafterrather thanwork.pytest tests/core/test_application.py tests/core/test_persistence.py tests/core/test_parallelism.py -q: 256 passed on Python 3.12.13.git diff --checkpass.pre-commit run --files burr/core/application.py tests/core/test_application.py: passed, including the frontend lint-staged and ASF header hooks.Notes
This concerns non-streaming step persistence. The streaming cleanup change in #1027 is already in the base. The top-level execute-hook reporting in #897 does not update
_astep's step hooks or persistence status.The existing cancellation still propagates to the caller. This does not shield persistence from repeated cancellation or change the handling of cancellation during a lifecycle hook.
This change was developed with an AI assistant. The reproduction and regression checks use no model or network service.
Checklist