Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions millpond/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
log = logging.getLogger(__name__)

_LAG_SAMPLE_INTERVAL_S = 60.0 # how often to query watermark offsets for lag metrics
_HEARTBEAT_INTERVAL_S = 60.0 # periodic log when idle (well under 300s liveness timeout)
_HEARTBEAT_INTERVAL_S = 60.0 # periodic log when idle (well under 480s liveness timeout)
# Longest a single consume() may block. record_poll() runs only after consume
# returns, and server.health marks the process dead at max_poll_age_s=300
# returns, and server.health marks the process dead at max_poll_age_s=480
# so a consume timeout derived from a large FLUSH_INTERVAL_MS (e.g. 10min)
# would starve the liveness probe on a quiet topic and SIGKILL the pod.
# 60s also keeps the idle heartbeat cadence honest.
Expand Down
3 changes: 2 additions & 1 deletion millpond/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
class _HealthState:
"""Tracks recency of poll and flush for health checks."""

def __init__(self, max_poll_age_s: float = 300):
# Allow slow writes to finish while staying below Kafka's 600s max poll interval.
def __init__(self, max_poll_age_s: float = 480):
self.max_poll_age_s = max_poll_age_s
self._last_poll: float = 0
self._last_flush: float = 0
Expand Down
Loading