Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#1,339 2 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@ishymko đang làm issue này rồi.

Từ ngày 15/10/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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).

Ngôn ngữ chính
Python
Star
2.2k
Fork
511
Merge trung bình
3 ngày 2 giờ
Pull request đã merge (30 ngày)
46

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của a2aproject/a2a-python

Tất cả issue của a2aproject/a2a-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.