apache / apache/rocketmq

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

Open Beginner friendly
#10,933 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
22.6k
Forks
12k
Avg merge
3d 1h
Merged PRs (30d)
27

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.

Contributor guide

Open the contributing guide

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.