ethanlin01x opened a new pull request, #3891: URL: https://github.com/apache/iggy/pull/3891
## Which issue does this PR address? Relates to #3776 (Found while reviewing) ## Rationale Zero-valued durations reach loops that spin or panic. The CLI hits this today: `IggyDuration::from_str` maps `0`, `none`, `disabled` and `unlimited` to the same zero, so `--tcp-heartbeat-interval none` produces a ping loop with no delay between round trips. #3776 guarded this inside the Python binding, but the hazard is not Python-specific. The fence belongs in the Rust SDK, where every binding funnels through. ## What changed? Validation added to five functions that already return `Result`: - `TcpClient::create`, `QuicClient::create`, `WebSocketClient::create` — zero `heartbeat_interval`, or zero `reconnection.interval` with unlimited retries. The heartbeat task is transport-agnostic, so all three shared the bug. - `IggyConsumer::init` — zero `init_retry_interval` (panics `time::interval`), `polling_retry_interval` (spins a core), or auto-commit interval (background task spins from spawn). - `ProducerCore::init` — zero send retries interval, and only when a retry count is set. Zero stays legal where it means something: bounded fast-retry, reconnection disabled, auto-commit modes carrying no interval, and no retry budget. Behavior change: `--tcp-heartbeat-interval none` and its `--quic-` / `--websocket-` equivalents now fail with `InvalidConfiguration` instead of silently spinning. ## Local Execution - Passed - Pre-commit hooks ran ## AI Usage 1. Which tools? Claude 2. Scope of usage? help implement and review this PR 3. How did you verify the generated code works correctly? Unit tests pin each rejected and each still-legal combination 4. Can you explain every line of the code if asked? Yes, all the changes are checked by the human. -- 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]
