NUAAwqy opened a new pull request, #1498: URL: https://github.com/apache/rocketmq-clients/pull/1498
Fixes 1497 (nine defects verified against the Python client, each reproduced offline and cross-checked against the Java reference implementation). - **Retry policy**: `attempt <= 0` validation on both policies; `initial/max/multiplier` checked with `is not None` so `initial_backoff=0` means "retry immediately" as in Java's `immediatelyRetryPolicy`; cross-type `__eq__` returns `NotImplemented` instead of raising. - **Protobuf Duration typing**: new `Misc.fill_proto_duration` fills int64 `seconds` + `nanos` from int/float seconds (sub-second precision preserved); used at the three request-construction sites that previously assigned floats into int64 fields. - **Push consumer**: missing/zero `delivery_attempt` is normalized to 1 on the nack path (matching Java `ProcessQueueImpl#nackMessage`); nack retries are capped at 3 attempts and the message is evicted when giving up, so a poisoned endpoint can no longer block the FIFO queue forever or crash the thread with `RecursionError`; backoff-policy dispatch follows the server's `WhichOneof` (exponential honored, matching Java `PushSubscriptionSettings`). - **Producer**: throttled requests (`TooManyRequestsException`) now back off via `get_next_attempt_delay` and retry — sync path sleeps, async path schedules via a daemon timer — instead of aborting on the first throttle; non-throttled errors keep the immediate resend as in Java; misleading docstrings corrected. Tests: 30 new offline unit tests across 4 files (policy boundaries, None-`delivery_attempt` nack path, backoff dispatch, duration typing, producer retry timing with stubbed RPCs); full suite `pytest rocketmq/v5/test` — 38 passed (8 pre-existing unchanged). -- 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]
