You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(manifest): let a job stop its own service before it runs #239
A before-rollout job runs while the previous version of its service keeps serving. That's right for additive migrations, but a migration that drops or renames something the previous version still uses breaks it for the length of the job and the rollout.
piquel.fr hits this in sourceorigin-dev/sourceorigin#128: 0003 drops sessions.management_expires_at, which every session query of the running auth release reads. Between the migration and the new release going live, auth fails every request that loads a session.
volume_access = "exclusive" can't help. It stops the services that mount the job service's writable volumes, but auth mounts none (the job is rejected with job_volume_access_invalid), and the only writable volume belongs to postgres, which the migration needs.
Proposed solution
Let a job stop its own service before it runs:
[[spec.jobs]]
name = "migrate"service = "auth"command = ["auth-service", "migrate"]
run = "before-rollout"stop_service = true
Once the job's dependencies are ready, the previous version of auth stops, and the job starts after its containers have exited. The service starts again with the rollout. If the job fails or the deployment is cancelled, active-target repair starts it again, as it already does for services stopped by an exclusive job. Plans warn with the existing job_stops_services.
This trades a short, explicit outage for never running the old code against a schema it doesn't understand. Expand/contract migrations remain the way to avoid the outage when it matters.
Note
Written by Claude Opus 5.5 in Claude Code (via T3 Code)
Activity
feat(manifest): let a job stop its own service before it runs (#349)