RockteMQ-AI commented on issue #1426: URL: https://github.com/apache/rocketmq-clients/issues/1426#issuecomment-6311199991
**Issue Evaluation** Category: `type/bug` | Status: **Confirmed** The reported issue has been verified against the current codebase (commit `a3d1de8b`). **Root Cause:** 1. `receive_with` and `change_invisible_duration` use `.unwrap()` on `prost_types::Duration::try_from(invisible_duration)`, which panics when the duration exceeds the valid range (max ~292 years for `prost_types::Duration`, but the issue reports panic at values > ~292 years). 2. No validation for `batch_size` being negative or zero before passing to the gRPC call. **Code Location:** `rust/src/simple_consumer.rs:172` and `:204` — both use `prost_types::Duration::try_from(invisible_duration).unwrap()`. **Impact:** Applications crash instead of receiving a proper error when invalid inputs are provided. This violates Rust's error-handling conventions and makes the client less robust. **Severity:** Medium — robustness issue. Can be worked around by validating inputs before calling the API, but the library should handle this gracefully. **Comparison with Java:** Java client validates inputs and throws `IllegalArgumentException` with clear error messages. An automated fix proposal will be generated. Reply `/approve` to proceed with PR generation. --- *Automated evaluation by RockteMQ-AI* -- 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]
