pawhost and realtoxmedia sat at about 50K overdue checks for good. Their checkers work at capacity. Dispatch keeps queuing a new run every interval, even while the previous run of the same monitor still waits, so a checker that once fell behind works off runs from minutes ago forever and the backlog never shrinks.
Queue entries now carry their dispatch time: monitor|scheduled|dispatched. Entries without it, from before this release, are still parsed and never dropped. The overdue script reads the scheduled time with a pattern, so the extra field does not disturb it.
Take drops runs that waited longer than 2 intervals. A newer run of the monitor is queued by then, because the next run is due at most 1.5 intervals after a dispatch (phase rule). So the only run of a monitor is never dropped.
If a whole pop is stale, Take pops on instead of returning empty-handed.
New metric uptimesebi_checks_stale_total.
Result claims: 10 minutes instead of 2 hours
claimResults keeps one Redis key per check result (result:<instance>:<monitor>:<ts>) against duplicate reports. With a TTL of 2 h and about 530 results/s, that was 4.46M keys, 1.1 GiB of the shared Redis (limit 1.5 GiB, no eviction), which puts the writes of other apps at risk. Retries come with the next report or the first one after an API outage, so the TTL is now 10 min: about 300K keys, roughly 70 MiB. Existing keys expire on their own within 2 h after rollout.
Tests
TestTakeDropsStaleRuns: a run is still handed out after 2 intervals and dropped after more, in favour of the newer one.
TestTakeSkipsAllStaleRuns: a pop with only stale runs is followed by the next pop.
TestParseEntry: old and new format, plus invalid entries.
Metrics test covers Stale.
go test ./... with DB and Redis, and golangci-lint: green.
## Drop runs left queued for too long
pawhost and realtoxmedia sat at about 50K overdue checks for good. Their checkers work at capacity. Dispatch keeps queuing a new run every interval, even while the previous run of the same monitor still waits, so a checker that once fell behind works off runs from minutes ago forever and the backlog never shrinks.
- Queue entries now carry their dispatch time: `monitor|scheduled|dispatched`. Entries without it, from before this release, are still parsed and never dropped. The overdue script reads the scheduled time with a pattern, so the extra field does not disturb it.
- `Take` drops runs that waited longer than **2 intervals**. A newer run of the monitor is queued by then, because the next run is due at most 1.5 intervals after a dispatch (phase rule). So the only run of a monitor is never dropped.
- If a whole pop is stale, `Take` pops on instead of returning empty-handed.
- New metric `uptimesebi_checks_stale_total`.
## Result claims: 10 minutes instead of 2 hours
`claimResults` keeps one Redis key per check result (`result:<instance>:<monitor>:<ts>`) against duplicate reports. With a TTL of 2 h and about 530 results/s, that was **4.46M keys, 1.1 GiB** of the shared Redis (limit 1.5 GiB, no eviction), which puts the writes of other apps at risk. Retries come with the next report or the first one after an API outage, so the TTL is now **10 min**: about 300K keys, roughly 70 MiB. Existing keys expire on their own within 2 h after rollout.
## Tests
- `TestTakeDropsStaleRuns`: a run is still handed out after 2 intervals and dropped after more, in favour of the newer one.
- `TestTakeSkipsAllStaleRuns`: a pop with only stale runs is followed by the next pop.
- `TestParseEntry`: old and new format, plus invalid entries.
- Metrics test covers `Stale`.
- `go test ./...` with DB and Redis, and golangci-lint: green.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
A checker that fell behind kept working off runs from minutes ago while
dispatch queued newer runs of the same monitors behind them, so a backlog
never shrank: pawhost and realtoxmedia stayed at about 50K overdue checks.
Queued runs now record when they were dispatched, and Take drops runs
that waited longer than two intervals. A newer run of the monitor has
been queued by then, since the next run is due at most one and a half
intervals after a dispatch. uptimesebi_checks_stale_total counts them.
Result claims, one Redis key per check result, lived 2 hours although
retries come within minutes. At about 530 results a second that was
4.5 million keys and 1.1 GiB of the shared Redis. They now live 10
minutes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi
merged commit 3bc927a5f7 into main2026-11-29 18:44:08 +00:00
Sebi
deleted branch fix/stale-runs-claim-ttl2026-11-29 18:44:10 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Drop runs left queued for too long
pawhost and realtoxmedia sat at about 50K overdue checks for good. Their checkers work at capacity. Dispatch keeps queuing a new run every interval, even while the previous run of the same monitor still waits, so a checker that once fell behind works off runs from minutes ago forever and the backlog never shrinks.
monitor|scheduled|dispatched. Entries without it, from before this release, are still parsed and never dropped. The overdue script reads the scheduled time with a pattern, so the extra field does not disturb it.Takedrops runs that waited longer than 2 intervals. A newer run of the monitor is queued by then, because the next run is due at most 1.5 intervals after a dispatch (phase rule). So the only run of a monitor is never dropped.Takepops on instead of returning empty-handed.uptimesebi_checks_stale_total.Result claims: 10 minutes instead of 2 hours
claimResultskeeps one Redis key per check result (result:<instance>:<monitor>:<ts>) against duplicate reports. With a TTL of 2 h and about 530 results/s, that was 4.46M keys, 1.1 GiB of the shared Redis (limit 1.5 GiB, no eviction), which puts the writes of other apps at risk. Retries come with the next report or the first one after an API outage, so the TTL is now 10 min: about 300K keys, roughly 70 MiB. Existing keys expire on their own within 2 h after rollout.Tests
TestTakeDropsStaleRuns: a run is still handed out after 2 intervals and dropped after more, in favour of the newer one.TestTakeSkipsAllStaleRuns: a pop with only stale runs is followed by the next pop.TestParseEntry: old and new format, plus invalid entries.Stale.go test ./...with DB and Redis, and golangci-lint: green.🤖 Generated with Claude Code
https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3