Menu

Boot the Release Against a Copy of Production Before You Switch
πŸ“°

Boot the Release Against a Copy of Production Before You Switch

DEV Community: cicdΒ·JΓΆrg HalitschkeΒ·about 15 hours ago
#kqdVYlbv
#devtocicd#devto#dev#deploy#release
Reading 0:00
15s threshold

The deploy script already had a rollback. Switch the current symlink, restart the systemd unit, poll /healthz , and if that fails, switch back and restart again. On paper that's a safe deploy.

In practice, every broken release still produced an outage. The reverse proxy returned 502 from the moment the old process stopped until the rollback had brought it back β€” up to about 35 seconds in the worst case, and a few seconds even after the health check learned to fail fast . A post-switch health check can't prevent that. It runs after the damage, and its only job is to bound it.

The fix was to move the question "does this release start?" to before the switch, and to ask it against the real data.

TL;DR: Before touching current , the deploy now copies the live SQLite database with VACUUM INTO , starts the new release on a free localhost port against that copy with a throwaway config and session secret and every outbound job disabled, and waits for /healthz .…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.