Small updates of TopicRetryableStream & added LazyExecutor - #721
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #721 +/- ##
============================================
+ Coverage 73.11% 73.13% +0.01%
- Complexity 3566 3581 +15
============================================
Files 391 392 +1
Lines 16497 16548 +51
Branches 1730 1736 +6
============================================
+ Hits 12062 12102 +40
- Misses 3817 3823 +6
- Partials 618 623 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
KirillKurdyukov
left a comment
There was a problem hiding this comment.
Requesting changes for three reproducible issues:
-
Late completion of the old stream can detach the replacement retry stream (TopicRetryableStream.java:57). After
fail()removes stream A and starts stream B, A may complete asynchronously. Its callback then callsrealStream.getAndSet(null), removes B, and handles A's status as if it belonged to B. In the reproduced scenario this setsisClosedand all subsequentsend()calls are dropped. The callback should clear only its captured stream, e.g. withcompareAndSet(stream, null), and pass that same stream toonStreamStop. -
LazyExecutornever grows beyond one worker (LazyExecutor.java:46). Because theLinkedBlockingQueueis unbounded,ThreadPoolExecutoralways queues after the single core thread and never reachesMAX_EXECUTOR_THREADS_COUNT = 4. A blocking task therefore stalls every later task. Please either use four core workers for a fixed pool or a bounded/direct-handoff queue for an elastic pool. -
A retry scheduling failure leaves the stream logically open (TopicRetryableStream.java:146). When
scheduler.schedule(...)throws,onCloseis called butisClosedremains false. As a resultisClosed()reports the wrong state andstart()is still allowed after terminal closure. Please set the terminal state before invokingonClose.
The existing tests pass, but I reproduced all three cases with focused regression tests; each currently fails.
No description provided.