Skip to content

Commit 9ebda06

Browse files
committed
KafkaProducer: Flush pending records before close()
1 parent 5360d79 commit 9ebda06

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kafka/producer/kafka.py

+1
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ def __getattr__(self, name):
506506
assert timeout >= 0
507507

508508
log.info("Closing the Kafka producer with %s secs timeout.", timeout)
509+
self.flush(timeout)
509510
invoked_from_callback = bool(threading.current_thread() is self._sender)
510511
if timeout > 0:
511512
if invoked_from_callback:

0 commit comments

Comments
 (0)