[ISSUE #10933] Retain receipt handles when offline cleanup cannot complete - #10934
[ISSUE #10933] Retain receipt handles when offline cleanup cannot complete#10934Aias00 wants to merge 2 commits into
Conversation
Signed-off-by: liuhy <liuhongyu@apache.org>
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
LGTM. This fix correctly addresses the race condition where receipt handles were being removed before the async renewal completed.
Key change:
- Changed from fire-and-forget (
CompletableFuture.completedFuture(null)) to waiting for the renewal result (future.thenApply(ackResult -> null)) - This ensures failed renewals retain the handle for the scheduler retry path
Test coverage:
- New test
testClearGroupRetainsHandleWhenRenewalFailsvalidates the failure scenario - Existing
testClearGroupcontinues to cover the success path
Clean, focused fix with proper test validation.
Automated review by github-manager-bot
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #10934 +/- ##
=============================================
- Coverage 48.62% 48.50% -0.12%
+ Complexity 13692 13650 -42
=============================================
Files 1381 1381
Lines 101464 101469 +5
Branches 13187 13188 +1
=============================================
- Hits 49337 49221 -116
- Misses 46142 46232 +90
- Partials 5985 6016 +31 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: liuhy <liuhongyu@apache.org>
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
Re-review after new commits. The updated changes properly handle RejectedExecutionException when the return-handle worker thread pool is saturated — instead of silently losing receipt handles, the group is put back into the map for the next scheduling cycle. The async completion fix (future.thenApply(ackResult -> null) instead of CompletableFuture.completedFuture(null)) correctly chains the renew future so the handle is only cleared after the renew operation actually completes.
The test coverage for both scenarios (renewal failure and submission rejection) is solid.
LGTM.
Automated review by github-manager
Summary
Keep POP receipt handles in the cleanup group whenever offline CLEAR_GROUP work cannot complete:
Validation
JAVA_HOME=$(/usr/libexec/java_home -v 17) mvn -pl proxy -Dtest=DefaultReceiptHandleManagerTest testCloses #10933
Closes #10941