Skip to content

Commit 2997a57

Browse files
committed
Return float(inf) seconds instead of sys.maxsize int in coordinator time to next poll()
1 parent 2f713cf commit 2997a57

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

kafka/coordinator/base.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,14 @@ def poll_heartbeat(self):
321321
self.heartbeat.poll()
322322

323323
def time_to_next_heartbeat(self):
324+
"""Returns seconds (float) remaining before next heartbeat should be sent
325+
326+
Note: Returns infinite if group is not joined
327+
"""
324328
with self._lock:
325329
# if we have not joined the group, we don't need to send heartbeats
326330
if self.state is MemberState.UNJOINED:
327-
return sys.maxsize
331+
return float('inf')
328332
return self.heartbeat.time_to_next_heartbeat()
329333

330334
def _handle_join_success(self, member_assignment_bytes):

0 commit comments

Comments
 (0)