fix(ws): decouple loader liveness heartbeat from batch processing#60916
Merged
estefaniarabadan merged 2 commits intoJun 1, 2026
Merged
Conversation
Gilbert09
approved these changes
Jun 1, 2026
Contributor
|
Contributor
|
Size Change: 0 B Total Size: 80.9 MB ℹ️ View Unchanged
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The loader consumer refreshes its liveness heartbeat only at the top of each poll cycle, before it awaits batch processing. When a large final-batch Delta compaction makes a cycle exceed the 60s liveness timeout, the heartbeat goes stale,
/_livenessreturns 503, and Kubernetes restarts the pod mid-batch. The consumer handlesSIGTERMgracefully (exit 0), so this looks like benignCompletedrestarts, but each one abandons the in-flight batch, and enough repeats exhaustmax_attemptsand fail the run. Under load it becomes a self-reinforcing restart loop.Changes
_heartbeat_loop()task that reports liveness every 5s, independent of batch processing (started inrun(), cancelled in_close()).How did you test this code?
Test pass and new tests
Automatic notifications
Docs update
NO
🤖 Agent context
Co-Authored with PostHog Code (Claude Code). The diagnosis used the team's
investigating-warehouse-sources-loadskill