Skip to content

fix: cache schedule validation, serve the last snapshot after a failed refresh, no error leaks (#193) - #197

Merged
jrosskopf merged 1 commit into
mainfrom
fix/gh-193-reliability
Oct 4, 2026
Merged

jrosskopf merged 1 commit into
mainfrom
fix/gh-193-reliability

Conversation

@jrosskopf

@jrosskopf jrosskopf commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

From the crew review; reproduced against a real binary first.

Summary

  • cache.schedule: 5x aborted the whole process (the heartbeat worker threw outside its try). Schedules are validated at load and in the cache API; 64-bit, positive, <= 10y; scheduler exceptions are contained per endpoint; a failing refresh backs off one interval (it retried every scan).
  • A failed refresh of a built cache took the endpoint to 503. It now stays Ready (stale) and keeps serving the last snapshot; /health says degraded (200) with a stale list. A never-built cache is still 503.
  • The raw DuckDB error (SQL, file paths) was returned to anonymous callers in the 503 body and by /health; now log-only.

Test plan

  • test_cache_reliability.py: 15 tests, 10 failed before (process abort x7 schedules, API 400, stale serving + leak, retry storm); stable 6/6 runs
  • C++ unit (readiness test updated to the new semantics), 85 related cache/health/ducklake/heartbeat Python tests

Refs #193 - the rate-limit items (user key before auth, method-blind lookup, per-path bucket) are not in this PR.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

… failed refresh, stop leaking errors (#193)

- parseInterval: 64-bit, positive, bounded; validated at config load and by the cache API
- Heartbeat worker contains per-endpoint exceptions and backs off after a failed refresh
- A failed refresh of a built cache stays Ready (stale); /health degraded 200 with a stale list
- No raw DuckDB error in the 503 body or /health (server log only)
- Real-binary tests incl. process-abort, stale serving, leak and retry-storm cases
- Refs #193 (rate-limit items remain)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant