Skip to content

Commit 62a7d80

Browse files
authored
Fix timeout seconds error message in KafkaProducer (#2627)
1 parent 452e354 commit 62a7d80

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kafka/producer/kafka.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ def _wait_on_metadata(self, topic, max_wait_ms):
944944
"""
945945
# add topic to metadata topic list if it is not there already.
946946
self._sender.add_topic(topic)
947-
timer = Timer(max_wait_ms, "Failed to update metadata after %.1f secs." % (max_wait_ms * 1000,))
947+
timer = Timer(max_wait_ms, "Failed to update metadata after %.1f secs." % (max_wait_ms / 1000,))
948948
metadata_event = None
949949
while True:
950950
partitions = self._metadata.partitions_for_topic(topic)
@@ -962,7 +962,7 @@ def _wait_on_metadata(self, topic, max_wait_ms):
962962
metadata_event.wait(timer.timeout_ms / 1000)
963963
if not metadata_event.is_set():
964964
raise Errors.KafkaTimeoutError(
965-
"Failed to update metadata after %.1f secs." % (max_wait_ms * 1000,))
965+
"Failed to update metadata after %.1f secs." % (max_wait_ms / 1000,))
966966
elif topic in self._metadata.unauthorized_topics:
967967
raise Errors.TopicAuthorizationFailedError(set([topic]))
968968
else:

0 commit comments

Comments
 (0)