diff --git a/millpond/main.py b/millpond/main.py index 1abd693..9547030 100644 --- a/millpond/main.py +++ b/millpond/main.py @@ -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. diff --git a/millpond/server.py b/millpond/server.py index 42cc142..dee6149 100644 --- a/millpond/server.py +++ b/millpond/server.py @@ -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