Skip to content

feat: jobs survive restarts across the network (worker drain + gateway persistence); v0.2.92 - #193

Merged
ralyodio merged 1 commit into
masterfrom
feat/resumable-jobs
Nov 9, 2026
Merged

ralyodio merged 1 commit into
masterfrom
feat/resumable-jobs

Conversation

@ralyodio

@ralyodio ralyodio commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Anthony asked that jobs be resumable across restarts on every node.

  • Workers: songs, images and videos hold a LongJob guard while they run. An auto-update still downloads and swaps the binary, but it re-executes only once no long job is running, with a 30-minute limit so a stuck job can't pin an old binary. Before this, every release killed whatever a node was rendering.
  • Gateway: tracked requests (those with x-request-id) are written to <data_dir>/gateway-jobs until they finish, and their results to <data_dir>/gateway-results (kept 30 minutes). After a restart, the gateway re-runs unfinished requests under the same id and serves finished ones from disk, so GET /v1/result/{id} keeps working. Tracked jobs also hold the guard, so the gateway drains before it updates too.
  • Tests: router() stays in memory for the loopback tests. Only the served gateway persists to disk.

Checks: clippy shows no new warnings. c0mpute-core lib tests pass 372 of 372 (including a disk round-trip across a simulated restart) and c0mpute-update passes 10 of 10 (including the drain test).

Bumps the version to v0.2.92, which also ships #191's video pin.

🤖 Generated with Claude Code

Anthony: "jobs should be resumable on restarts across the nodes".

- Workers: songs, images and videos hold a c0mpute_update::LongJob guard;
  an auto-update downloads and swaps the binary but re-execs only once no
  long job runs (max 30 min, so a stuck job cannot pin an old binary).
  Before, every release killed whatever a node was rendering.
- Gateway: tracked requests (x-request-id) are written to
  <data_dir>/gateway-jobs until they finish and their results to
  <data_dir>/gateway-results (30 min). After a restart the gateway re-runs
  unfinished requests under the same id and serves finished ones from
  disk, so GET /v1/result/{id} still delivers. Tracked jobs also hold a
  LongJob guard, so the gateway itself drains before updating.
- Loopback tests keep router() in memory; only the served gateway persists.

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

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

ThreatCrush Security Scan

13 finding(s)

HIGH/CRITICAL: 1 | MEDIUM: 8 | LOW: 4

Severity Rule Location
HIGH js-ssrf-outbound-request apps/web/public/sw.js:24
MEDIUM js-unescaped-html-sink apps/web/src/app/blog/[slug]/page.tsx:53
MEDIUM js-unescaped-html-sink apps/web/src/app/layout.tsx:80
MEDIUM sh-remote-script-execution scripts/dev-setup.sh:25
MEDIUM sh-eval-expansion scripts/dev-setup.sh:35
MEDIUM sh-remote-script-execution scripts/install.sh:181
MEDIUM sh-remote-script-execution scripts/install.sh:206
MEDIUM sh-remote-script-execution scripts/install.sh:399
MEDIUM sh-remote-script-execution scripts/install.sh:441
LOW py-ssrf-outbound-request examples/business-strategist-agent/chat.py:37
LOW py-ssrf-outbound-request examples/business-strategist-agent/train.py:54
LOW secret-generic-credential node/crates/c0mpute-core/src/webhook.rs:1165
LOW py-path-traversal node/crates/c0mpute-core/tests/fixtures/fake-infernet-text:29

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit 84275eb into master Nov 9, 2026
14 checks passed
@ralyodio
ralyodio deleted the feat/resumable-jobs branch November 9, 2026 09:14
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