leizhiyuan opened a new pull request, #1463: URL: https://github.com/apache/rocketmq-clients/pull/1463
### Which Issue(s) This PR Fixes Fixes #1460 ### Brief Description `Client::ack_message` returned `result[0]` of the ack response entries, so `SimpleConsumer::ack` / `LiteSimpleConsumer::ack` panicked with "index out of bounds" when the server answered OK without any result entry. The only caller discarded the value. - `Client::ack_message` now returns `Result<(), ClientError>` and only checks the status, like Java `SimpleConsumerImpl#ack0`. - Public API unchanged (`SimpleConsumer::ack` already returned `Result<(), ClientError>`). #### Notes for reviewers - Merges cleanly with #1452–#1457 except #1454, where the conflict is only in the test module of `client.rs` (tests added at the same place). I will rebase whichever lands second. ### How Did You Test This Change? **Unit test**, fails on `master`: - `client_ack_message_without_result_entry`: `Client::ack_message` against a session whose `AckMessage` returns OK with no entries must return `Ok` (`master`: panics at `client.rs:787`). **End-to-end** (test environment in #1460 and #1445): `SimpleConsumer`, 16 tasks receive(32) + ack each, mock server answering acks without entries: `master` panics on the first ack of every task in 3 of 3 runs; this PR consumes 4,308 msg/s with no panic, the same as against a server that returns entries. ``` $ 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) ``` --- Found while building the benchmark for #1445. -- 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]
