[iris] Chunk fail_heartbeats_batch to release SQLite writer between groups#4845
Merged
[iris] Chunk fail_heartbeats_batch to release SQLite writer between groups#4845
Conversation
…roups Previously one transaction covered the entire failure batch, holding the SQLite writer for ~30s when a zone-wide failure reaped hundreds of workers and starving RegisterEndpoint, Register, LaunchJob, and apply_heartbeats_batch behind BEGIN IMMEDIATE. Commit per FAIL_HEARTBEATS_CHUNK_SIZE=10 workers so concurrent writers can interleave; heartbeat failures are idempotent so partial progress on crash is safe. Bumps worker's controller-client timeout from 5s to 60s so workers ride out the residual slow RPCs rather than abandoning them. Benchmark script adds _measure_tail_latency / _measure_drain_tail_latency probes with A/B (1-txn vs chunk=10) against a cloned snapshot. x50 run shows max add_endpoint latency during a failure batch drop from 5.3s to 2.4s; drain_dispatch_all drops from 5.4s to 2.9s; batch wall time unchanged.
Contributor
|
Claude finished @rjpower's task in 4m 3s —— View job Code review complete
No issues found. Checked for bugs and CLAUDE.md compliance. Full review posted as a separate comment on this PR. Highlights of what was verified:
|
Contributor
|
🤖 ### Code review No issues found. Checked for bugs and CLAUDE.md compliance. Notes on what was verified:
|
ravwojdyla
approved these changes
Apr 16, 2026
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.
Previously one transaction covered the entire failure batch, holding the SQLite writer for ~30s when a zone-wide failure reaped hundreds of workers and starving RegisterEndpoint, Register, LaunchJob, and apply_heartbeats_batch behind BEGIN IMMEDIATE. Commit per chunk (default 10) so concurrent writers can interleave; heartbeat failures are idempotent so partial progress on crash is safe. Also bumps the worker's controller-client timeout from 5s to 60s so workers ride out residual slow RPCs rather than abandoning them. Benchmark adds tail-latency A/B probes; x50 run shows max add_endpoint latency during a failure batch drop from 5.3s to 2.4s, drain_dispatch_all from 5.4s to 2.9s, batch wall time unchanged.