Skip to content

Commit 00d527f

Browse files
committed
Update base.py
Our app uses `SimpleProducer` and logs lots of these warnings (from line 438): producer.stop() called, but producer is not async This destructor appears to be the cause. (Also, is it wise to do a thread join from a destructor?)
1 parent 59ac7d6 commit 00d527f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kafka/producer/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -471,5 +471,5 @@ def stop(self, timeout=None):
471471
self.stopped = True
472472

473473
def __del__(self):
474-
if not self.stopped:
474+
if self.async and not self.stopped:
475475
self.stop()

0 commit comments

Comments
 (0)