Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

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

Aberta
#1,339 2 comentários 0 reações 1 responsável Ver no GitHub

Mantenedores costumam responder em até 2 dias

@ishymko já está trabalhando nisso.

Desde 15/10/2026.

Avaliação

Esta issue ainda não foi avaliada.

Descrição

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

Linguagem predominante
Python
Estrelas
2.2k
Forks
511
Merge médio
3d 7h
PRs com merge (30d)
46

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de a2aproject/a2a-python

Todas as issues de a2aproject/a2a-python

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.