Skip to content

Commit

Permalink
Merge pull request #27 from aiven/keejon/bugfix-check-version
Browse files Browse the repository at this point in the history
bugfix: catch KeyError in check_version and retry
  • Loading branch information
aiven-anton authored Feb 27, 2024
2 parents d911914 + 2726465 commit 4ffdc97
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion kafka/client_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,13 @@ def check_version(self, node_id=None, timeout=2, strict=False):
self._lock.release()
raise Errors.NoBrokersAvailable()
self._maybe_connect(try_node)
conn = self._conns[try_node]
try:
conn = self._conns[try_node]
except KeyError:
if node_id is not None:
self._lock.release()
raise Errors.NodeNotReadyError()
continue

# We will intentionally cause socket failures
# These should not trigger metadata refresh
Expand Down

0 comments on commit 4ffdc97

Please sign in to comment.