{{ message }}
Repository navigation
fix(server): fix deadlocks on agent execution failure in non-streaming - #614
Merged
Merged
Conversation
Fixes a2aproject#609 by ensuring producer task cancellation and immediate queue closure when the consumer fails. Includes regression test.
Contributor
Contributor
There was a problem hiding this comment.
Code Review
This pull request effectively addresses potential deadlocks and resource leaks by ensuring that producer tasks and their associated queues are properly cleaned up when an agent execution fails, especially in streaming and non-blocking scenarios. The changes in on_message_send and on_message_send_stream correctly cancel the producer and close the queue on consumer failure. The modification in _cleanup_producer is also crucial for ensuring cleanup logic runs reliably. I have one suggestion to improve logging in the cleanup path to avoid silently swallowing exceptions.
holtskinner
approved these changes
Jan 9, 2026
1 task done
ishymko
self-requested a review
February 12, 2026 09:54
ishymko
approved these changes
Feb 12, 2026
This was referenced Feb 12, 2026
ishymko
pushed a commit
that referenced
this pull request
Feb 17, 2026
🤖 I have created a release *beep* *boop* --- ## [0.3.23](v0.3.22...v0.3.23) (2026-02-13) ### Features * add async context manager support to BaseClient ([#688](#688)) ([ae9dc88](ae9dc88)) * add async context manager support to ClientTransport ([#682](#682)) ([2e45c0d](2e45c0d)) * support async card modifiers ([#654](#654)) ([a802500](a802500)) * support disabling OTel instrumentation via env var ([#611](#611)) ([72216b9](72216b9)) ### Bug Fixes * do not crash on SSE comment line ([#636](#636)) ([3dcb847](3dcb847)) * gRPC metadata header casing and invocation_metadata() call ([#676](#676)) ([390b763](390b763)) * Improve error handling for Timeout exceptions on REST and JSON-RPC clients ([#690](#690)) ([2acd838](2acd838)) * map rejected task state in proto converters ([#668](#668)) ([957e92b](957e92b)), closes [#625](#625) * **server:** fix deadlocks on agent execution failure in non-streaming ([#614](#614)) ([d3c973f](d3c973f)) ### Documentation * explicitly mention supported spec version and transports in readme ([#681](#681)) ([c91d4fb](c91d4fb)), closes [#677](#677) * Update README to include Code Wiki badge ([2698cc0](2698cc0)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
lithammer
added a commit
to lithammer/kagent
that referenced
this pull request
Feb 18, 2026
The main motivation is that it includes this fix: - a2aproject/a2a-python#614 It's described in more detail from a kagent perspective here: - kagent-dev#1268 Signed-off-by: Peter Lithammer <peter.lithammer@embark-studios.com>
EItanya
pushed a commit
to kagent-dev/kagent
that referenced
this pull request
Feb 18, 2026
The main motivation is that it includes this fix: - a2aproject/a2a-python#614 It's described in more detail from a kagent perspective here: - #1268 Signed-off-by: Peter Lithammer <peter.lithammer@embark-studios.com>
This was referenced Mar 12, 2026
Raghavendiran-2002
pushed a commit
to Raghavendiran-2002/kagent
that referenced
this pull request
Apr 30, 2026
The main motivation is that it includes this fix: - a2aproject/a2a-python#614 It's described in more detail from a kagent perspective here: - kagent-dev#1268 Signed-off-by: Peter Lithammer <peter.lithammer@embark-studios.com>
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.

This PR addresses potential deadlocks and resource leaks in the DefaultRequestHandler when agent execution fails, particularly in non-streaming scenarios.
Fixes #609 🦕