fix(server): warn when queue_manager is ignored in DefaultRequestHandlerV2 - #1153
Open
NishchayMahor wants to merge 1 commit into
Open
fix(server): warn when queue_manager is ignored in DefaultRequestHandlerV2#1153NishchayMahor wants to merge 1 commit into
NishchayMahor wants to merge 1 commit into
Conversation
…lerV2 DefaultRequestHandlerV2 accepts a queue_manager for signature compatibility but never stores or uses it — v2 delegates event streaming to an in-memory ActiveTaskRegistry, so a custom or distributed QueueManager (e.g. Redis for multi-replica reconnection) is silently dropped. Emit a warning at construction so the misconfiguration is visible, pointing at the LegacyRequestHandler / task-affinity workarounds. Fixes a2aproject#1135
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/server/request_handlers/default_request_handler_v2.py | 94.17% | 94.20% | 🟢 +0.03% |
| Total | 92.97% | 92.97% | ⚪️ 0.00% |
Generated by coverage-comment.yml
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.
Summary
Fixes #1135.
DefaultRequestHandlerV2.__init__accepts aqueue_managerargument (kept for signature compatibility withDefaultRequestHandler) but never stores or uses it. As @rohityan confirmed on the issue, v2 delegates event streaming to an in-memoryActiveTaskRegistry, so any custom or distributedQueueManager— e.g. a Redis-backed one used for multi-replica stream reconnection — is silently dropped. After upgrading, multi-replica streaming breaks with no error or warning.Fix
Emit a
logger.warningat construction when a non-Nonequeue_manageris passed, explaining that it is ignored in v2 and pointing at the documented workarounds (switch toLegacyRequestHandler, or route/tasks/{id}:subscribeto the replica holding theActiveTask). This turns a silent misconfiguration into a visible one without changing v2's architecture. Also corrected the now-inaccurate inline comment on the parameter.Evidence
default_request_handler_v2.py__init__bindsagent_executor/task_store/etc. but has noself._queue_manager = queue_manager(contrastdefault_request_handler.py:123, which does store it and uses it at lines 209/313/503/611).self._active_task_registry = ActiveTaskRegistry(...).Testing
Added two tests to
tests/server/request_handlers/test_default_request_handler_v2.py:test_init_warns_when_queue_manager_passed— asserts a WARNING mentioningqueue_manageris logged (fails onmain, passes with the fix).test_init_no_warning_without_queue_manager— asserts no such warning in the default case.ruff check,ruff format --check, andty checkall clean on the changed files.This change was developed with AI assistance; I verified the root cause and behavior against the code paths cited above, reviewed every line, and ran the tests.