Skip to content

Commit 411b7dc

Browse files
committed
Messages could be leaked&lost if exception raised from callback triggered by poll()
1 parent 6ef1ae4 commit 411b7dc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

confluent_kafka/src/Consumer.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,11 @@ static PyObject *Consumer_poll (Handle *self, PyObject *args,
727727
rkm = rd_kafka_consumer_poll(self->rk, tmout >= 0 ?
728728
(int)(tmout * 1000.0f) : -1);
729729

730-
if (!CallState_end(self, &cs))
730+
if (!CallState_end(self, &cs)) {
731+
if (rkm)
732+
rd_kafka_message_destroy(rkm);
731733
return NULL;
734+
}
732735

733736
if (!rkm)
734737
Py_RETURN_NONE;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy