Skip to content

[ISSUE #10933] Retain receipt handles when offline cleanup cannot complete - #10934

Open
Aias00 wants to merge 2 commits into
apache:developfrom
Aias00:fix/proxy-retry-offline-receipt-cleanup
Open

[ISSUE #10933] Retain receipt handles when offline cleanup cannot complete#10934
Aias00 wants to merge 2 commits into
apache:developfrom
Aias00:fix/proxy-retry-offline-receipt-cleanup

Conversation

@Aias00

@Aias00 Aias00 commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Keep POP receipt handles in the cleanup group whenever offline CLEAR_GROUP work cannot complete:

  • retain groups when asynchronous renewal fails so the scheduler can retry;
  • restore groups when the cleanup executor rejects task submission.

Validation

  • JAVA_HOME=$(/usr/libexec/java_home -v 17) mvn -pl proxy -Dtest=DefaultReceiptHandleManagerTest test

Closes #10933
Closes #10941

Signed-off-by: liuhy <liuhongyu@apache.org>

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 testClearGroupRetainsHandleWhenRenewalFails validates the failure scenario
  • Existing testClearGroup continues to cover the success path

Clean, focused fix with proper test validation.


Automated review by github-manager-bot

@codecov-commenter

codecov-commenter commented Aug 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 48.50%. Comparing base (293f588) to head (5c34f63).

Files with missing lines Patch % Lines
...y/service/receipt/DefaultReceiptHandleManager.java 87.50% 0 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: liuhy <liuhongyu@apache.org>
@Aias00 Aias00 changed the title [ISSUE #10933] Retain receipt handles after failed offline cleanup [ISSUE #10933] Retain receipt handles when offline cleanup cannot complete Aug 16, 2026

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants