Skip to content

Commit

Permalink
bugfix: catch KeyError in check_version and retry
Browse files Browse the repository at this point in the history
  • Loading branch information
keejon authored and rushidave committed Feb 28, 2024
1 parent 1a6bf01 commit c662d94
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 c662d94

Please sign in to comment.