Skip to content

Commit e4a8c0f

Browse files
committed
Trigger broker connection-retry (when down) if any requests are enqueued
1 parent 1e8e6e0 commit e4a8c0f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/rdkafka_broker.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4794,8 +4794,11 @@ static void rd_kafka_broker_serve (rd_kafka_broker_t *rkb, int timeout_ms) {
47944794
/* rkb_persistconn.internal is the per broker_serve()
47954795
* automatic counter that keeps track of anything
47964796
* in the producer/consumer logic needs this broker connection
4797-
* to be up. */
4798-
rkb->rkb_persistconn.internal = 0;
4797+
* to be up.
4798+
* The value is reset here on each serve(). If there are queued
4799+
* requests we know right away that a connection is needed. */
4800+
rkb->rkb_persistconn.internal =
4801+
rd_atomic32_get(&rkb->rkb_outbufs.rkbq_cnt) > 0;
47994802

48004803
if (rkb->rkb_source == RD_KAFKA_INTERNAL)
48014804
rd_kafka_broker_internal_serve(rkb, abs_timeout);

0 commit comments

Comments
 (0)