Skip to content

fix(server): warn when queue_manager is ignored in DefaultRequestHandlerV2 - #1153

Open
NishchayMahor wants to merge 1 commit into
a2aproject:mainfrom
NishchayMahor:fix/v2-warn-ignored-queue-manager
Open

fix(server): warn when queue_manager is ignored in DefaultRequestHandlerV2#1153
NishchayMahor wants to merge 1 commit into
a2aproject:mainfrom
NishchayMahor:fix/v2-warn-ignored-queue-manager

Conversation

@NishchayMahor

Copy link
Copy Markdown

Summary

Fixes #1135.

DefaultRequestHandlerV2.__init__ accepts a queue_manager argument (kept for signature compatibility with DefaultRequestHandler) but never stores or uses it. As @rohityan confirmed on the issue, v2 delegates event streaming to an in-memory ActiveTaskRegistry, so any custom or distributed QueueManager — 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.warning at construction when a non-None queue_manager is passed, explaining that it is ignored in v2 and pointing at the documented workarounds (switch to LegacyRequestHandler, or route /tasks/{id}:subscribe to the replica holding the ActiveTask). 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

  • The parameter is dropped: default_request_handler_v2.py __init__ binds agent_executor/task_store/etc. but has no self._queue_manager = queue_manager (contrast default_request_handler.py:123, which does store it and uses it at lines 209/313/503/611).
  • v2 uses the registry instead: 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 mentioning queue_manager is logged (fails on main, passes with the fix).
  • test_init_no_warning_without_queue_manager — asserts no such warning in the default case.
uv run pytest tests/server/request_handlers/            # 195 passed

ruff check, ruff format --check, and ty check all 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.

…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
@NishchayMahor
NishchayMahor requested a review from a team as a code owner July 27, 2026 21:26
@github-actions

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: queue_manager passed to DefaultRequestHandler is silently ignored since v2

1 participant