Skip to content

fix(outprint): run only one package sync at a time - #39

Merged
fty4 merged 1 commit into
mainfrom
fix/outprint-sync-lock
Nov 8, 2026
Merged

fty4 merged 1 commit into
mainfrom
fix/outprint-sync-lock

Conversation

@fty4

@fty4 fty4 commented Nov 8, 2026

Copy link
Copy Markdown
Member

What

On the first install of homelab the start Job and the CronJob began in the same second and ran on the same PVC. One pod failed (exit 2) and the retry succeeded, but two syncs can delete each other's working folders, and a pod could activate the revision that another pod had prepared but not yet validated.

  • /packages/.lock (a directory, mkdir is atomic) is taken by the sync step. A second sync logs another sync holds the lock and does nothing. A lock older than 180 s is taken over (left behind by a pod that died or whose revision failed validation).
  • The revision id a pod prepared now lives in an emptyDir of that pod (/state/pending) instead of the PVC. validate and activate act only on what their own pod prepared, so a pod that skipped never activates someone else's revision.
  • The sync step gives the lock back when it ends without a revision (already active, error); the activate step gives it back after switching over.
  • Chart 1.3.2.

Test plan

  • ct lint passes
  • Two syncs started together in Docker (Job capabilities, two local repositories): one prepares the revision, the other skips and its activate does nothing and keeps the lock
  • validate reads the pod's own state; activate switches current and releases the lock
  • Already active, error (unresolvable ref) and a stale lock: the lock is released or taken over
  • Next change of a source in the cluster

@fty4
fty4 merged commit c3bb4c3 into main Nov 8, 2026
2 checks passed
@fty4
fty4 deleted the fix/outprint-sync-lock branch November 8, 2026 14:54
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