Skip to content

Keep workers healthy when switching a site's PHP runtime#524

Merged
geodro merged 1 commit into
mainfrom
fix/runtime-switch-workers
Jun 12, 2026
Merged

Keep workers healthy when switching a site's PHP runtime#524
geodro merged 1 commit into
mainfrom
fix/runtime-switch-workers

Conversation

@geodro

@geodro geodro commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Switching a site between FPM and FrankenPHP left its worker units pointing at the previous container. Going back to FPM removed the per-site FrankenPHP container while the queue and schedule units still had BindsTo and exec'd into it, so the workers could not start and healing could not recover them, since the healer only resets and restarts a unit and never rewrites one. The runtime switch now stops the site's running workers and recreates them against the new container in both directions, so they always exec into the container that actually exists.

A second issue compounded it. WorkerStartForSite rewrote a changed unit but never asked systemd to re-read it, so enable and start operated on the stale cached unit and a re-pointed worker kept failing on the old container even though the file on disk was already correct. It now runs a daemon-reload whenever the unit content changed, before enabling and starting, which also makes any on-demand worker start robust to a content change.

Switching a site between FPM and FrankenPHP left its worker units pointing at the previous container. Going back to FPM removed the per-site FrankenPHP container while the queue and schedule units still had BindsTo and exec'd into it, so the workers could not start and heal could not recover them, since heal only resets and restarts a unit and never rewrites one. The runtime switch now stops the site's running workers and recreates them against the new container in both directions.

A second issue compounded it: WorkerStartForSite rewrote a changed unit but never asked systemd to re-read it, so enable and start acted on the stale cached unit. It now runs a daemon-reload whenever the unit content changed, before enabling and starting.
@geodro geodro merged commit 1b2eb0d into main Jun 12, 2026
3 checks passed
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