Skip to content

Commit ccb95d9

Browse files
authored
Revert setting timeout to infinity (confluentinc#5201)
* Revert setting timeout to infinity * style fix * Changelog change * Changelog changes * Changelog change
1 parent be00619 commit ccb95d9

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ librdkafka v2.12.0 is a feature release:
99
* Fix for an error being raised after a commit due to an existing error in the topic partition (#4672).
1010
* Additional KIP-320 related validation: when assigning the offset is validated
1111
if leader epoch is specified (#4931).
12+
* Fix double free of headers in `rd_kafka_produceva` method (@blindspotbounty, #4628).
13+
* Fix to ensure `rd_kafka_query_watermark_offsets` enforces the specified timeout and does not continue beyond timeout expiry (#5201).
1214

1315

1416
## Fixes
@@ -23,6 +25,9 @@ librdkafka v2.12.0 is a feature release:
2325
so it's possible it did overlap with the periodic `topic.metadata.refresh.interval.ms`
2426
and cause a re-bootstrap even if not needed.
2527
Happening since 2.11.0 (#5177).
28+
* Issues: #4878.
29+
Fix to ensure `rd_kafka_query_watermark_offsets` enforces the specified timeout and does not continue beyond timeout expiry.
30+
Happening since 2.3.0 (#5201).
2631

2732
### Telemetry fixes
2833

@@ -45,6 +50,12 @@ librdkafka v2.12.0 is a feature release:
4550
from last available offset of given leader epoch.
4651
Happens since 2.1.0 (#4931).
4752

53+
### Producer fixes
54+
55+
* Issues: #4627.
56+
Fix double free of headers in `rd_kafka_produceva` method in cases where the partition doesn't exist.
57+
Happening since 1.x (@blindspotbounty, #4628).
58+
4859

4960

5061
# librdkafka v2.11.1

src/rdkafka.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3805,6 +3805,7 @@ rd_kafka_resp_err_t rd_kafka_query_watermark_offsets(rd_kafka_t *rk,
38053805
struct rd_kafka_partition_leader *leader;
38063806
rd_list_t leaders;
38073807
rd_kafka_resp_err_t err;
3808+
int tmout;
38083809

38093810
partitions = rd_kafka_topic_partition_list_new(1);
38103811
rktpar =
@@ -3851,9 +3852,13 @@ rd_kafka_resp_err_t rd_kafka_query_watermark_offsets(rd_kafka_t *rk,
38513852

38523853
/* Wait for reply (or timeout) */
38533854
while (state.err == RD_KAFKA_RESP_ERR__IN_PROGRESS) {
3854-
rd_kafka_q_serve(rkq, RD_POLL_INFINITE, 0,
3855-
RD_KAFKA_Q_CB_CALLBACK, rd_kafka_poll_cb,
3856-
NULL);
3855+
tmout = rd_timeout_remains(ts_end);
3856+
if (rd_timeout_expired(tmout)) {
3857+
state.err = RD_KAFKA_RESP_ERR__TIMED_OUT;
3858+
break;
3859+
}
3860+
rd_kafka_q_serve(rkq, tmout, 0, RD_KAFKA_Q_CB_CALLBACK,
3861+
rd_kafka_poll_cb, NULL);
38573862
}
38583863

38593864
rd_kafka_q_destroy_owner(rkq);

0 commit comments

Comments
 (0)