Skip to content

fix(cold-store): keep the Turso export inside the nightly's time - #12112

Merged
dezren39 merged 1 commit into
mainfrom
fix/cold-store-nightly-timeout
Nov 21, 2026
Merged

dezren39 merged 1 commit into
mainfrom
fix/cold-store-nightly-timeout

Conversation

@dezren39

@dezren39 dezren39 commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Before: on Nov 20 the cold-store nightly was stopped at its 2-hour limit while it was still downloading the atlas Turso dump, which is now past 10 GB. atlas is first in the list, so none of the other 49 Turso databases were backed up that night, the prune, manifest sync and status steps never ran, and the stopped run left the 10 GB dump and a minted database token in /tmp until the next night.

After: atlas is exported last, the Turso step keeps inside a 3-hour budget so the steps after it still run, and a stopped run cleans up its scratch, which is now private to the user.

How:

  • export-turso.sh: TURSO_EXPORT_LAST (default atlas) moves the named databases to the end. TURSO_EXPORT_DEADLINE_SECONDS (default 10800) stops new databases from starting once spent and clamps each dump's --max-time and --retry-max-time to what is left. The dump --max-time default goes from 1800 to 3600. The scratch dir is 0700 under umask 077, and a TERM/INT trap lets the EXIT cleanup run when systemd stops the unit.
  • nixos/home/laptop-backups.nix: cold-store-nightly TimeoutStartSec 120m to 360m. This part takes effect at the next Home Manager switch on the laptop.
  • Tests: atlas ordering, an empty TURSO_EXPORT_LAST keeping list order, deadline clamping, no start after the deadline, deadline validation, and a SIGTERM mid-download removing the 0700 scratch. python3 -m unittest discover -s tests in pkgs/cold-store-reaper: 213 tests pass (1 skipped). shellcheck and ruff find nothing new against main.

Generated by Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

On 2026-11-20 cold-store-nightly was killed at its 120m start timeout
while still downloading atlas's dump (past 10 GB). atlas is listed
first, so none of the other 49 Turso databases were filed, the D1
prune, manifest sync and status steps never ran, and the killed run
left the 10 GB dump and a minted token in /tmp until the next night.

- export-turso.sh exports TURSO_EXPORT_LAST (default atlas) after
  every other database.
- A whole-step budget, TURSO_EXPORT_DEADLINE_SECONDS (default 3h):
  no database starts once it is spent, and each dump's --max-time
  and --retry-max-time are clamped to what is left.
- Dump --max-time default 1800 -> 3600.
- The scratch dir is 0700 under umask 077, and a TERM/INT trap lets
  the EXIT cleanup run when systemd stops the unit.
- laptop-backups.nix: cold-store-nightly TimeoutStartSec 120m -> 360m.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 45 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fc55c913-30a7-4812-9586-715f615f4bf2
Commits

Reviewing files that changed from the base of the PR and between 5e7ddb3 and 6a48d74.

Files selected for processing: 4

  • nixos/home/laptop-backups.nix
  • pkgs/cold-store-reaper/README.md
  • pkgs/cold-store-reaper/scripts/export-turso.sh
  • pkgs/cold-store-reaper/tests/test_export_turso.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39
dezren39 marked this pull request as ready for review November 21, 2026 06:05
@dezren39
dezren39 requested a review from a team as a code owner November 21, 2026 06:05
@dezren39
dezren39 merged commit 1d6fe1b into main Nov 21, 2026
@dezren39
dezren39 deleted the fix/cold-store-nightly-timeout branch November 21, 2026 06:05
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T06:06:22.533468Z 6a48d74 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

2 participants