@@ -216,6 +216,8 @@ def __init__(self, **configs):
216
216
self ._connecting = set ()
217
217
self ._sending = set ()
218
218
self ._refresh_on_disconnects = True
219
+
220
+ # Not currently used, but data is collected internally
219
221
self ._last_bootstrap = 0
220
222
self ._bootstrap_fails = 0
221
223
@@ -233,8 +235,6 @@ def __init__(self, **configs):
233
235
self .config ['metric_group_prefix' ],
234
236
weakref .proxy (self ._conns ))
235
237
236
- self ._num_bootstrap_hosts = len (collect_hosts (self .config ['bootstrap_servers' ]))
237
-
238
238
# Check Broker Version if not set explicitly
239
239
if self .config ['api_version' ] is None :
240
240
check_timeout = self .config ['api_version_auto_timeout_ms' ] / 1000
@@ -259,20 +259,6 @@ def _close_wakeup_socketpair(self):
259
259
self ._wake_r = None
260
260
self ._wake_w = None
261
261
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
-
276
262
def _can_connect (self , node_id ):
277
263
if node_id not in self ._conns :
278
264
if self .cluster .broker_metadata (node_id ):
0 commit comments