You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
int_latency stat is wildly wrong (huge negative value) when message.timeout.ms is set to infinite (0) #5555
The int_latency metric in stats (average time a message spends in the producer's internal queue before being sent) is computed incorrectly when message.timeout.ms=0 (infinite timeout), which is a common setting for idempotent/transactional producers.
The calculation base uses rkm_ts_timeout (enqueue time + timeout), but when the timeout is disabled, rkm_ts_timeout is set to INT64_MAX. Subtracting that from now underflows to a huge negative number, corrupting the rkb_avg_int_latency window and any downstream consumer of the int_latency stat (dashboards, alerting, etc.).
Fix and detailed before/after explanation here: #5335 — it switches the base from rkm_ts_timeout to rkm_ts_enq (enqueue time), which is well-defined regardless of timeout and yields the correct queue latency in both cases. The PR has been open since 2026-02-28 without review; filing this issue to make the underlying bug visible/trackable independently of the PR queue.
How to reproduce
Configure a producer with message.timeout.ms=0.
Enable statistics via statistics.interval.ms and register a stats callback (rd_kafka_conf_set_stats_cb), which receives the stats as a JSON-formatted string — this is the only interface librdkafka exposes for stats, regardless of language/API used.
Observe brokers.<broker>.int_latency in the emitted stats JSON — min/max/avg will show a huge negative number instead of a small positive latency in microseconds.
IMPORTANT: Always try to reproduce the issue on the latest released version (see https://github.com/confluentinc/librdkafka/releases), if it can't be reproduced on the latest version the issue has been fixed.
Checklist
librdkafka version (release number or git tag): master / v2.15.0 (bug present, confirmed by reading current source)
Apache Kafka version: not relevant, this is a client-side stats bug
Thanks for picking this up, Ojasva Jain (@ojasvajain) — just checking in. The fix is already up in #5335 (small, self-contained, no API/ABI impact, CLA signed). Happy to help if anything's needed from my side — otherwise it should be ready for review/merge as-is.
Activity
x0id commentedon Aug 4, 2026
Thanks for picking this up, Ojasva Jain (@ojasvajain) — just checking in. The fix is already up in #5335 (small, self-contained, no API/ABI impact, CLA signed). Happy to help if anything's needed from my side — otherwise it should be ready for review/merge as-is.
ojasvajain commentedon Aug 13, 2026
Hi Dmitriy Kargapolov (@x0id), thanks for raising this issue and the PR. This seems like a genuine bug. I will take a look at the PR.
Add changelog entry and test for int_latency fix
Fix int_latency calculation for infinite timeout (#5335)
ojasvajain commentedon Aug 25, 2026
#5335 is merged. Closing this issue.