File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -151,6 +151,7 @@ class KafkaClient(object):
151
151
'bootstrap_servers': 'localhost',
152
152
'client_id': 'kafka-python-' + __version__,
153
153
'request_timeout_ms': 30000,
154
+ 'max_block_ms': 60000,
154
155
'connections_max_idle_ms': 9 * 60 * 1000,
155
156
'reconnect_backoff_ms': 50,
156
157
'reconnect_backoff_max_ms': 1000,
@@ -198,6 +199,7 @@ def __init__(self, **configs):
198
199
self._bootstrap_fails = 0
199
200
self._wake_r, self._wake_w = socket.socketpair()
200
201
self._wake_r.setblocking(False)
202
+ self._wake_w.settimeout(self.config['max_block_ms'] / 1000.0)
201
203
self._wake_lock = threading.Lock()
202
204
203
205
self._lock = threading.RLock()
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ class Sender(threading.Thread):
29
29
'acks': 1,
30
30
'retries': 0,
31
31
'request_timeout_ms': 30000,
32
+ 'max_block_ms': 60000,
32
33
'guarantee_message_order': False,
33
34
'client_id': 'kafka-python-' + __version__,
34
35
'api_version': (0, 8, 0),
You can’t perform that action at this time.
0 commit comments