Fix cancelled ingest waiters wedging sessions - #3993
Open
SabhyaC26 wants to merge 1 commit into
Open
Conversation
Contributor
|
| await asyncio.sleep(0.05) | ||
| cancelled.cancel() | ||
| with contextlib.suppress(asyncio.CancelledError): | ||
| await cancelled |
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.
Related issue
N/A
Summary
asyncio.Lock, so cancelled waiters are removed instead of permanently blocking the queue.ELI5: A cancelled request used to keep its number in line forever. The standard lock drops cancelled waiters, so the next message can move forward.
flowchart LR A[Active ingest] --> B[Cancelled waiter] B --> C[Later message] B -. removed from lock queue .-> CTest Plan
pytest -q tests/runner/test_app_sessions_native_workflow_messages.py— 25 passed.pre-commit run --files omnigent/runner/app.py tests/runner/test_app_sessions_native_workflow_messages.py— all applicable hooks passed, including Ruff and Pyrefly.sleep 3, queued a follow-up during the active turn, and sent another message afterward; the session returnedLIVE_READY,FIRST_DONE,SECOND_DONE, andTHIRD_DONEwithout wedging.Demo
N/A — backend concurrency fix with no visual change.
Type of change
Test coverage
Coverage notes
The new regression cancels a waiter parked behind a slow ingest and verifies the next message completes. The existing ordering test confirms FIFO delivery is preserved. Manual verification exercised the full browser → server → host → runner path.
Changelog
Sessions continue accepting messages when a queued wake request is cancelled.