[Bug]: ActiveTask.start() leaves the event queue dispatchers pending when setup fails
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
What happened?
ActiveTask (src/a2a/server/agent_execution/active_task.py) creates its two EventQueueSource queues in __init__, and each EventQueueSource starts its dispatcher task as soon as it is created (src/a2a/server/events/event_queue_v2.py):
self._dispatcher_task = asyncio.create_task(self._dispatch_loop())
When the setup in start() fails, the except block marks the task as finished and re-raises, but never closes the queues:
except Exception:
logger.debug('ActiveTask[%s]: Setup failed, cleaning up', self._task_id)
self._is_finished.set()
if self._reference_count == 0 and self._on_cleanup:
self._on_cleanup(self)
raise # _event_queue_agent and _event_queue_subscribers stay open
The setup fails when the stored task is in a terminal state (UnsupportedOperationError) or is missing and create_task_if_missing is false (TaskNotFoundError). With DefaultRequestHandler, a SendMessage to a completed task takes the first path, so each rejected request leaves two _dispatch_loop tasks pending. Once they are garbage collected, asyncio logs:
Task was destroyed but it is pending!
task: <Task pending name='Task-28' coro=<EventQueueSource._dispatch_loop() ...>>
On a server built with DefaultRequestHandler, InMemoryTaskStore and the JSON-RPC and REST routes, six SendMessage requests to completed tasks log this twelve times.
Suggested fix: close both queues in the except block, before _on_cleanup:
await self._event_queue_agent.close(immediate=True)
await self._event_queue_subscribers.close(immediate=True)
aclose() already closes the queues the same way, but it can't be called here because it takes _lock, which start() holds.
I have a fix ready and I'm opening a PR alongside this issue.
Code of Conduct
- I agree to follow this project's Code of Conduct
- Ngôn ngữ chính
- Python
- Star
- 2.2k
- Fork
- 532
- Merge trung bình
- 3 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 42
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của a2aproject/a2a-python
-
[Bug]: `A2A-Version` validation ignores minor versions and the query parameterCó thể đã có người làm @rohityan đã nhận 71 ngày trước. Đang mởcomponent: server status:awaiting response status:stale
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
a2aproject/a2a-python#1204 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug]: REST task/request id sanitizationCó thể đã có người làm @Linux2010 đã nhận 130 ngày trước. Đang mởmaintainers-only
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
a2aproject/a2a-python#805 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug]: v0.3 REST client raises NotImplementedError for list_task_push_notification_configsCó thể đã có người làm @RaphaelFakhri đã nhận hôm nay. Đang mởcomponent: client status:awaiting response
a2aproject/a2a-python#1423 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Compat REST client drops security from the v0.3 extended agent cardCó thể đã có người làm @ConnorMoss02 đã nhận hôm nay. Đang mởcomponent: client status:awaiting response
a2aproject/a2a-python#1418 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
v0.3 JSON-RPC returns -32600 instead of -32602 for invalid paramsCó thể đã có người làm @ConnorMoss02 đã nhận 1 ngày trước. Đang mởcomponent: server status:awaiting response
a2aproject/a2a-python#1417 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của a2aproject/a2a-python
Issue tương tự
-
bug severity:low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
curriculum documentation quality
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
githubnext/gh-aw-workshop#5367 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
OAuth documentation for GET /api/v2/users/me/ appears inconsistent with required global read scopeĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Create Noise Latents ignores randomize_seed and produces the same noise every runCó thể đã có người làm @griptapeops đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
griptape-ai/griptape-nodes-library-diffusers#127 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Jenkins capacity report: metrics history is lost when archiving a month failsCó thể đã có người làm @RaphaelFakhri đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
adoptium/infrastructure#4568 ·
Maintainer thường phản hồi trong vòng 1 ngày