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

   ### Which Issue(s) This PR Fixes
   
   Fixes #1450
   
   ### Brief Description
   
   `process_assignments` shut the removed queue actors down, waiting for their 
in-flight long polling (up to 43 s by default), before starting the newly 
assigned queues; the telemetry loop was blocked meanwhile. Java only marks a 
dropped process queue as dropped.
   
   - `process_assignments` returns the removed actors instead of shutting them 
down.
   - The scan loop shuts them down in a background `TaskTracker` 
(`dropped_actors`). Consumer shutdown first shuts down the current actors, then 
waits for `dropped_actors`, so shutdown still waits for every in-flight request 
(Java `waitingReceiveRequestFinished`).
   
   #### Notes for reviewers
   
   - Textual conflict with #1451's PR (same scan loop). Suggested order: 
#1451's PR first, I rebase this one; see #1445.
   
   ### How Did You Test This Change?
   
   **Unit test**, fails on `master`:
   
   - `test_process_assignments_does_not_wait_for_removed_queue_long_polling`: 
queue 0 is in an 800 ms poll and the assignment moves to queue 1; 
`process_assignments` must return in < 200 ms (master: 794 ms), queue 1 must be 
polled, and the removed actor must finish in the background without sending 
another receive.
   - `test_process_assignments_two_queues` now also checks the returned actor.
   
   **End-to-end** (mock proxy over real gRPC; queue 0 is held in a 10 s long 
poll, the assignment moves to queue 1, 3 runs): first receive on queue 1 after 
it is assigned **10,040 ms → 1 ms**.
   
   
   ```
   $ cargo test                                                   # lib: 151 
passed, 0 failed (master: 150)
   $ cargo clippy --all-features -- -D warnings                   # clean
   $ cargo fmt --check                                            # clean
   $ RUSTDOCFLAGS='--cfg docsrs' cargo doc --no-deps --all-features   # ok
   $ cargo build --examples --all-features                        # ok
   $ cargo +1.74.0 check --all-features --tests --examples        # ok (MSRV)
   ```
   
   ---
   
   Part of #1445 (overview, end-to-end benchmark and merge order).
   


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