Refresh metadata on failed connection attempts

This commit is contained in:
Dana Powers
2016-01-09 13:39:05 -08:00
parent 651454a074
commit 5975de8b79

View File

@@ -161,6 +161,11 @@ class KafkaClient(object):
elif node_id in self._connecting:
log.debug("Node %s connection state is %s", node_id, state)
self._connecting.remove(node_id)
if state is ConnectionStates.DISCONNECTED:
log.warning("Node %s connect failed -- refreshing metadata", node_id)
self.cluster.request_update()
return state
def ready(self, node_id):