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

   ## Purpose
   
   Bound `GracefulStop` when the proxy is down or restarting.
   
   ## Changes
   
   - `golang/push_consumer.go`: `defaultPushConsumer` owns `receiveCtx` /
     `receiveCancel`; the context is created with the consumer and canceled as 
the
     first step of `GracefulStop`.
   - `receiveMessage` returns `ctx.Err()` on cancellation instead of reporting a
     deadline, so the cancellation is distinguishable from a normal timeout.
   - `golang/process_queue.go`: long polls use the consumer receive context;
     canceled polls close the RECEIVE hook with an error status but do not log a
     reception failure or schedule another receive.
   - `golang/client.go`: `notifyClientTermination` notifies all route targets
     concurrently and waits on a `sync.WaitGroup`.
   - Test: a receive stream that blocks until its context is canceled must not
     stretch `GracefulStop` beyond a few seconds.
   
   ## Test plan
   
   `go build ./...`, `go vet .`, `go test -count=1 .` (includes
   `TestGracefulStopCancelsInflightReceiveRequest`). Real-cluster result in 
#1473:
   with a SIGSTOP-ed proxy and an in-flight long poll, `GracefulStop` took 4.1 s
   vs 19.6 s on master.
   
   ---
   
   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