Repository navigation
fix(a2a): prevent task lifecycle races - #3828
Merged
Merged
Conversation
Use atomic cache registration and identity-aware cleanup for agents and subscriptions so an old stream cannot remove or cancel a restarted task.
jujn
approved these changes
Oct 29, 2026
Merged
5 tasks done
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.
AgentScope-Java Version
2.1.0-SNAPSHOT (based on
7653eb7ec)Description
This fixes two related lifecycle races when the same A2A task ID is stopped and restarted:
ReActAgentwithputIfAbsentRegression tests cover concurrent starts, old-stream cleanup after restart, synchronous stream creation failure, and replacement subscriptions created during cancellation.
Testing
mvn -B -T1C -pl agentscope-extensions/agentscope-extensions-protocol/agentscope-extensions-a2a/agentscope-extensions-a2a-server -am test(186 A2A Server tests)mvn -B -T1C clean verify(99-module reactor)Checklist
mvn spotless:apply