Repository navigation
Commit 18d2abf
authored
fix: Eliminate intermittent failure in testQueueClosedEventTerminates… (#631)
…RemoteSubscribers
Two-part fix for race condition in Kafka replication test:
1. EventQueue: Signal polling started BEFORE any early returns
- Moved signalQueuePollerStarted() to beginning of dequeueEventItem()
- Previously in finally block, which didn't execute if queue was closed
- Race: If queue closed before first dequeue, EventQueueClosedException
thrown BEFORE try block, so finally never ran and signal never sent
- Now always signals even if queue immediately throws on closure
2. Test: Replace unreliable Thread.sleep with proper synchronization
- Inject QueueManager to access the queue for the task
- Replace Thread.sleep(2000) with queueManager.awaitQueuePollerStart()
- Ensures EventConsumer is actually polling before sending
QueueClosedEvent
- Add debug logging to diagnose future failures
Root cause: signalQueuePollerStarted() was only called in finally block,
which was skipped when queue was already closed at first dequeue
attempt. This caused awaitQueuePollerStart() to hang or timeout
intermittently.1 parent 767ca43 commit 18d2abf
2 files changed
Lines changed: 42 additions & 26 deletions
File tree
- extras/queue-manager-replicated/tests-single-instance/src/test/java/io/a2a/extras/queuemanager/replicated/tests
- server-common/src/main/java/io/a2a/server/events
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| 51 | + | |
| 52 | + | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| |||
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
| 61 | + | |
| 62 | + | |
57 | 63 | | |
58 | 64 | | |
59 | 65 | | |
| |||
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
68 | 77 | | |
69 | 78 | | |
70 | 79 | | |
| |||
367 | 376 | | |
368 | 377 | | |
369 | 378 | | |
370 | | - | |
371 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
372 | 384 | | |
373 | 385 | | |
374 | 386 | | |
| |||
384 | 396 | | |
385 | 397 | | |
386 | 398 | | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
387 | 403 | | |
388 | 404 | | |
389 | 405 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
665 | 669 | | |
666 | 670 | | |
667 | 671 | | |
| |||
672 | 676 | | |
673 | 677 | | |
674 | 678 | | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
683 | 684 | | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
698 | 695 | | |
699 | | - | |
700 | | - | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
701 | 701 | | |
702 | 702 | | |
703 | 703 | | |
| |||
0 commit comments