Description
In rd_kafka_toppar_leader_update, there is a potential reference leak of an rd_kafka_toppar_t object: rd_kafka_toppar_get increments the rktp_refcnt reference count, but the code path that returns due to outdated metadata leader epoch does not free that reference.
The following patch should correct this:
diff --git a/src/rdkafka_topic.c b/src/rdkafka_topic.c
index fbaa53bc..32fc3118 100644
--- a/src/rdkafka_topic.c
+++ b/src/rdkafka_topic.c
@@ -678,6 +678,7 @@ static int rd_kafka_toppar_leader_update(rd_kafka_topic_t *rkt,
rktp->rktp_leader_epoch);
if (rktp->rktp_fetch_state == RD_KAFKA_TOPPAR_FETCH_ACTIVE) {
rd_kafka_toppar_unlock(rktp);
+ rd_kafka_toppar_destroy(rktp); /* from get() */
return 0;
}
}
Checklist
IMPORTANT: We will close issues where the checklist has not been completed.
Please provide the following information:
Description
In
rd_kafka_toppar_leader_update, there is a potential reference leak of anrd_kafka_toppar_tobject:rd_kafka_toppar_getincrements therktp_refcntreference count, but the code path that returns due to outdated metadata leader epoch does not free that reference.The following patch should correct this:
Checklist
IMPORTANT: We will close issues where the checklist has not been completed.
Please provide the following information:
debug=..as necessary) from librdkafka