@@ -216,6 +216,8 @@ def __init__(self, **configs):
216216 self ._connecting = set ()
217217 self ._sending = set ()
218218 self ._refresh_on_disconnects = True
219+
220+ # Not currently used, but data is collected internally
219221 self ._last_bootstrap = 0
220222 self ._bootstrap_fails = 0
221223
@@ -233,8 +235,6 @@ def __init__(self, **configs):
233235 self .config ['metric_group_prefix' ],
234236 weakref .proxy (self ._conns ))
235237
236- self ._num_bootstrap_hosts = len (collect_hosts (self .config ['bootstrap_servers' ]))
237-
238238 # Check Broker Version if not set explicitly
239239 if self .config ['api_version' ] is None :
240240 check_timeout = self .config ['api_version_auto_timeout_ms' ] / 1000
@@ -259,20 +259,6 @@ def _close_wakeup_socketpair(self):
259259 self ._wake_r = None
260260 self ._wake_w = None
261261
262- def _can_bootstrap (self ):
263- effective_failures = self ._bootstrap_fails // self ._num_bootstrap_hosts
264- backoff_factor = 2 ** effective_failures
265- backoff_ms = min (self .config ['reconnect_backoff_ms' ] * backoff_factor ,
266- self .config ['reconnect_backoff_max_ms' ])
267-
268- backoff_ms *= random .uniform (0.8 , 1.2 )
269-
270- next_at = self ._last_bootstrap + backoff_ms / 1000.0
271- now = time .time ()
272- if next_at > now :
273- return False
274- return True
275-
276262 def _can_connect (self , node_id ):
277263 if node_id not in self ._conns :
278264 if self .cluster .broker_metadata (node_id ):
0 commit comments