LiyunZhang10 opened a new pull request, #10259:
URL: https://github.com/apache/rocketmq/pull/10259

   ## Which Issue(s) This PR Fixes
   
   - Fixes #9583
   
   ## Brief Description
   
   After `changeInvisibleDuration` succeeds, `ChangeInvisibleDurationActivity` 
removes the old receipt handle from `ReceiptHandleManager` (line 53) but never 
re-registers the new handle returned by the broker. This causes two problems:
   
   1. **Ack fails silently**: When the client sends ack using the new handle, 
the Proxy's `AckMessageActivity.getHandleString()` calls 
`removeReceiptHandle()` which returns `null` (the new handle was never stored). 
The ack then goes directly to the broker with only the client-side handle, 
bypassing the Proxy's managed handle path.
   
   2. **Auto-renew stops**: The `ReceiptHandleManager.scheduleRenewTask()` 
mechanism loses track of the message entirely, since the handle was removed but 
never replaced. If the new invisible duration expires before the ack reaches 
the broker through the revive topic, the message gets redelivered — causing the 
duplicate consumption reported in #9583.
   
   ## Changes
   
   - In 
`ChangeInvisibleDurationActivity.convertToChangeInvisibleDurationResponse()`, 
after a successful response, decode the new receipt handle and re-register it 
into `ReceiptHandleManager` via `addReceiptHandle()`
   - Added unit test `testNewHandleIsReRegisteredAfterSuccess` to verify the 
new handle is properly registered after a successful changeInvisibleDuration


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to