Commit 3e93dd2
fix: Remove awaitQueuePollerStart to eliminate thread blocking bottleneck
Problem:
- TCK tests timing out in CI with 11 leaked agents (183 registered, 172 removed)
- Agent-executor threads blocking up to 10 seconds waiting for queue polling to start
- Cascading delays when Vert.x worker threads are busy (11 × 10s = 110s+ wasted time)
- Tests timeout at 5 minutes before cleanup can execute
Root Cause:
Agent-executor threads (limited pool of 15) were blocking in awaitQueuePollerStart()
waiting for Vert.x worker threads to become available and start polling queues.
This created a resource bottleneck where valuable executor threads sat idle.
Solution:
Remove synchronous wait and move queue lifecycle entirely to the consumer:
- Agent-executor thread: Returns immediately after execution, no blocking
- Consumer (Vert.x worker): Handles all queue lifecycle via EventConsumer.consumeAll()
- Background cleanup: Manages ChildQueue/MainQueue reference counting
Changes:
- DefaultRequestHandler.registerAndExecuteAgentAsync():
* Removed awaitQueuePollerStart() call
* Removed immediate queue closing in whenComplete()
* Added architecture documentation
- Queue lifecycle now managed entirely by EventConsumer.consumeAll()
which closes queue on final events/errors
Benefits:
- Eliminates cascading 10-second delays
- Better thread utilization (no idle blocking)
- Simpler architecture (consumer owns lifecycle)
- No race conditions (consumer running before it can close queue)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 09b1c17 commit 3e93dd2
File tree
2 files changed
+24
-18
lines changed- server-common/src/main/java/io/a2a/server/requesthandlers
- tck/src/main/resources
2 files changed
+24
-18
lines changedLines changed: 18 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
486 | 497 | | |
487 | 498 | | |
488 | 499 | | |
| |||
492 | 503 | | |
493 | 504 | | |
494 | 505 | | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
500 | 509 | | |
501 | 510 | | |
502 | 511 | | |
| |||
505 | 514 | | |
506 | 515 | | |
507 | 516 | | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
| 517 | + | |
| 518 | + | |
519 | 519 | | |
| 520 | + | |
| 521 | + | |
520 | 522 | | |
521 | 523 | | |
522 | 524 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| |||
0 commit comments