[Bug] Proxy drops receipt handles when offline cleanup renewal fails

Open Beginner friendly
#10,933 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
java

Research direction

Start at DefaultReceiptHandleManager.clearGroup and trace the ReceiptHandleGroup callback and RenewEvent future for the CLEAR_GROUP path. Add the regression test described in the issue for a failed offline cleanup renewal; done means failed renewal retains the receipt handle while successful renewal removes it.

Written by the indexing model from the issue text.

Description

Problem

When a consumer channel goes offline, DefaultReceiptHandleManager.clearGroup asynchronously renews each receipt handle with CLEAR_GROUP. The cleanup callback currently returns CompletableFuture.completedFuture(null) immediately instead of the RenewEvent future.

As a result, ReceiptHandleGroup removes the handle before the renewal outcome is known. If the renewal request fails, the handle is no longer retained or retried by the renewal scheduler.

Expected behavior

A receipt handle should be removed only after its CLEAR_GROUP renewal succeeds. On failure it should remain in the group so subsequent cleanup scheduling can retry it.

Proposed fix

Return the RenewEvent future from the ReceiptHandleGroup callback, mapping a successful result to null (remove) while preserving exceptional completion (retain). Add a regression test covering a failed offline cleanup renewal.

Scope

Proxy POP receipt-handle lifecycle; no protocol/API changes.

Dominant language
Java
Stars
22.6k
Forks
12k
Avg merge
3d 12h
Merged PRs (30d)
25

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/rocketmq

All issues in apache/rocketmq

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.