We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fbc242f commit d5c9a11Copy full SHA for d5c9a11
kafka/client.py
@@ -311,6 +311,13 @@ def load_metadata_for_topics(self, *topics):
311
(a single partition w/o a leader, for example)
312
"""
313
topics = [kafka_bytestring(t) for t in topics]
314
+
315
+ if topics:
316
+ for topic in topics:
317
+ self.reset_topic_metadata(topic)
318
+ else:
319
+ self.reset_all_metadata()
320
321
resp = self.send_metadata_request(topics)
322
323
log.debug("Broker metadata: %s", resp.brokers)
@@ -323,8 +330,6 @@ def load_metadata_for_topics(self, *topics):
330
topic = topic_metadata.topic
324
331
partitions = topic_metadata.partitions
325
332
326
- self.reset_topic_metadata(topic)
327
-
328
333
# Errors expected for new topics
329
334
try:
335
kafka.common.check_error(topic_metadata)
0 commit comments