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

   ## Purpose
   
   Bound the settlement retry chains so a message that can never be settled does
   not get retried once a second forever, and stop issuing RPCs for process 
queues
   that are already gone.
   
   This is the retry-budget counterpart of #1481. #1481 forgives only an 
explicit
   server-side `INVALID_RECEIPT_HANDLE` (40013); this PR handles every **other**
   failure (transport errors and other status codes) by limiting how long the
   existing retry chains keep going. The two PRs modify different functions and 
can
   be merged independently.
   
   ## Changes
   
   - `golang/process_queue.go`:
     - Add `MAX_ACK_MESSAGE_ATTEMPTS`, `MAX_CHANGE_INVISIBLE_DURATION_ATTEMPTS` 
and
       `MAX_FORWARD_MESSAGE_TO_DLQ_ATTEMPTS` (3 each). Past the cap,
       `forgiveSettlement` logs the give-up and invokes the callback, which 
evicts
       the cached message so the queue cache does not leak.
     - `settlementRetryGuard` stops a scheduled retry once the process queue has
       been dropped or the consumer is no longer running, handing the error to 
the
       callback so bookkeeping still happens. It is called from all three
       `...Later` schedulers.
     - `forwardToDeadLetterQueueLater` now waits
       `FORWARD_FIFO_MESSAGE_TO_DLQ_FAILURE_BACKOFF_DELAY` instead of the ack 
delay.
     - Correct two panic-recovery log labels that said "change invisible 
duration"
       in the DLQ / ack schedulers.
   - `golang/settlement_retry_test.go` (new, standalone helpers to avoid 
clashing
     with #1481): retry chains stop at exactly 3 attempts for ack and change
     invisible duration; retries stop after the process queue is dropped and 
after
     the consumer stops running.
   
   ## Scope
   
   No change to the immediate 40013 handling (#1481), reception back-off 
(#1482),
   shutdown cancellation (#1483), assignment scanning (#1484), SimpleConsumer
   errors (#1485) or log placeholders (#1486). Every attempt remains
   deadline-bounded (3 s RPC timeout) plus a 1 s back-off, so a chain gives up 
in
   roughly 8-12 s under sustained RPC failure.
   
   ## Test plan
   
   `go build ./...`, `go vet .`, `go test -count=1 .` in `golang/`.
   
   ---
   
   This PR is part of the split of #1473 into smaller, single-feature PRs for 
easier
   review. #1473 was merged and then reverted in #1480; this PR re-submits 
exactly
   one of its features as an atomic commit, based on current `master`
   (`00073932`) so it merges cleanly with no conflicts.
   
   Verified locally in `golang/`: `go build ./...`, `go vet .`, `go test 
-count=1 .`.
   


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