zhaohai666 opened a new pull request, #1481:
URL: https://github.com/apache/rocketmq-clients/pull/1481

   ## Purpose
   
   Bound the settlement retry chains (ack / change invisible duration / forward 
to
   DLQ) and immediately forgive expired receipt handles, so a message is not 
retried
   once a second forever under sustained RPC failure.
   
   ## Changes
   
   - `golang/process_queue.go`:
     - `changeInvisibleDuration0` converts a non-OK status into an error, so the
       existing `INVALID_RECEIPT_HANDLE` abandon branch was unreachable. The 
check
       now runs on the returned error first (`AsErrRpcStatus`), so an expired 
handle
       is forgiven immediately instead of being renewed forever.
     - Cap the three retry chains at `MAX_ACK_MESSAGE_ATTEMPTS`,
       `MAX_CHANGE_INVISIBLE_DURATION_ATTEMPTS` and
       `MAX_FORWARD_MESSAGE_TO_DLQ_ATTEMPTS` (3 each). The give-up callback 
evicts
       the cached message so the queue cache does not leak.
     - `settlementRetryGuard` stops scheduled retries once the process queue was
       dropped or the consumer is no longer running.
     - The DLQ chain forgives `INVALID_RECEIPT_HANDLE` (it previously never 
gave up
       on any status code) and uses its own back-off delay instead of the ack 
delay.
   - `golang/process_queue_test.go`: immediate forgiveness of an invalid receipt
     handle for renewal and DLQ, exactly 3 attempts for ack / renewal chains, 
and
     retries that stop after the queue is dropped or the consumer stops.
   
   ## Test plan
   
   `go build ./...`, `go vet .`, `go test -count=1 .`. Every attempt is
   deadline-bounded (3 s RPC timeout) plus a 1 s back-off, so the chains give 
up in
   ~8-12 s under sustained RPC failure.
   
   ---
   
   This PR is part of the split of #1473 into smaller, single-feature PRs for 
easier
   review. #1473 was merged as one large change; this branch reconstructs 
exactly one
   of its features as an atomic commit, based on `master`.
   
   Verified locally in `golang/`: `go build ./...`, `go vet .`, `go test 
-count=1 .`.
   
   > Note: #1473 is already merged upstream, so this PR is the atomic
   > reconstruction of one feature for independent review only.
   


-- 
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