Symlink Swaps Are Atomic — Your App Restart Is Not, and That Causes 502s

A developer discovered that Capistrano-style deployments using symlink swaps are not truly zero-downtime, despite the file switch being atomic. The real culprit is the service restart that follows: 'systemctl restart' stops the process entirely before starting it again, leaving the port unresponsive during the app's boot time. This gap produces hard 502 errors for every deploy, lasting as long as the application takes to initialize — often several seconds. Because the errors resolve on their own before most users can report them, the issue is frequently dismissed as flakiness rather than investigated. The article also highlights that even the widely recommended nginx 'proxy_next_upstream' directive fails to mask these errors in the configurations most developers actually use.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in