Skip to content

Commit c3c20cb

Browse files
authored
Fix OverflowError when connection_max_idle_ms is 0 or inf (#2538)
1 parent d5c4348 commit c3c20cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kafka/client_async.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from kafka.util import Dict, WeakMethod
3131
# Although this looks unused, it actually monkey-patches socket.socketpair()
3232
# and should be left in as long as we're using socket.socketpair() in this file
33-
from kafka.vendor import socketpair
33+
from kafka.vendor import socketpair # noqa: F401
3434
from kafka.version import __version__
3535

3636
if six.PY2:
@@ -1184,7 +1184,7 @@ def is_expired(self, conn_id):
11841184

11851185
def next_check_ms(self):
11861186
now = time.time()
1187-
if not self.lru_connections:
1187+
if not self.lru_connections or self.next_idle_close_check_time == float('inf'):
11881188
return float('inf')
11891189
elif self.next_idle_close_check_time <= now:
11901190
return 0

0 commit comments

Comments
 (0)