summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kafka/coordinator/base.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/kafka/coordinator/base.py b/kafka/coordinator/base.py
index 421360e..5cdbdcf 100644
--- a/kafka/coordinator/base.py
+++ b/kafka/coordinator/base.py
@@ -321,10 +321,14 @@ class BaseCoordinator(object):
self.heartbeat.poll()
def time_to_next_heartbeat(self):
+ """Returns seconds (float) remaining before next heartbeat should be sent
+
+ Note: Returns infinite if group is not joined
+ """
with self._lock:
# if we have not joined the group, we don't need to send heartbeats
if self.state is MemberState.UNJOINED:
- return sys.maxsize
+ return float('inf')
return self.heartbeat.time_to_next_heartbeat()
def _handle_join_success(self, member_assignment_bytes):