Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

DefaultRequestHandler (v2) ignores queue_manager, so the per-task event queue bound (1,024) cannot be configured

未關閉
#1,339 2 則留言 0 個 reaction 已指派 1 人 在 GitHub 檢視

維護者通常 2 天內回覆

@mykytanetipa 已經在處理了。

開始於 2026年10月19日。

評估

這個 Issue 還沒有評估資料。

描述

component: server status: needs review

Summary

Passing a queue_manager to DefaultRequestHandler produces

DeprecationWarning: A queue_manager was passed to DefaultRequestHandlerV2, but it is not used: v2 delegates
event streaming to an in-memory ActiveTaskRegistry, so custom or distributed QueueManager implementations
are ignored. ...

ActiveTask then builds its queues with the module default (EventQueueSource() /
DEFAULT_MAX_QUEUE_SIZE = 1024), and nothing on DefaultRequestHandler, ActiveTaskRegistry or
ActiveTask lets an application change it.

Why it matters

The bounded queue is what gives a streaming server backpressure: when a client connects and stops reading, the
queue fills, the producer (the agent executor) blocks and stops pulling tokens from the model, and a slow
subscriber is evicted. We verified this end to end and it works well. But 1,024 events is a fixed trade-off:

  • a deployment streaming single tokens may want a smaller bound (less memory per stalled client, faster
    eviction); one streaming large chunks may want a different one;
  • with many concurrent tasks the worst-case memory is tasks x 1,024 x event size, which the operator cannot
    tune.

Evidence

A client that opens POST /message:stream and never reads, against an agent producing 300,000 small events with
no delay: the SDK evicts the stalled sink ("queue full at delivery time"), process memory stays flat (about
80 MB), the server keeps answering other callers, and the task ends at its own deadline. So the mechanism is
sound; only its size is fixed.

Suggested change

Accept an optional size where the queues are created, for example DefaultRequestHandler(..., max_event_queue_size: int = DEFAULT_MAX_QUEUE_SIZE) passed to ActiveTaskRegistry and on to
EventQueueSource. Keep the default so nothing changes for existing users.

Environment

a2a-sdk 1.2.1 and 1.2.2, Python 3.11 to 3.13, FastAPI/Starlette routes via create_jsonrpc_routes and
create_rest_routes.

Found while building slow-consumer backpressure tests for a downstream adapter (lemonade-a2a).

主要語言
Python
星號
2.2k
分支
518
平均合併
3 天 12 小時
30 天內合併 PR
39

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

a2aproject/a2a-python 的其他 Issue

查看 a2aproject/a2a-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。