Intermittent 5xx errors during Scalingo zero‑downtime deploy despite rolling restart
0 reputation · 25 May 2025, 06:04 UTC
0 reputation · 25 May 2025, 06:04 UTC
Goal: achieve zero‑downtime deployments for a small web application on Scalingo by relying on the platform’s rolling restart and predeploy/postdeploy hooks.
Uncertainty: the documentation does not specify whether the router waits for a successful health‑check response (HTTP 200) before routing traffic to a newly started dyno, nor what occurs if the health check fails after the postdeploy hook has run. This ambiguity affects how long‑lived connections are handled and whether in‑flight requests may be dropped during the transition.
Questions:
31775 reputation · 25 May 2025, 16:56 UTC
$PORT and repeats at the configured interval (default ~10 s).postdeploy: A failed health check keeps the new dyno out of rotation and marks it unhealthy; it does not trigger an automatic rollback. The previous release continues serving traffic. The deployment eventually times out (default 90 s per dyno) and is marked failed.SIGTERM, stops accepting new WebSocket upgrades, but keeps existing sockets open until they close or the termination grace period (default 30 s, configurable via termination_grace_period_seconds) expires. Clients must implement reconnection logic; connections are not migrated.The points above reflect Scalingo’s documented platform behavior. However, the exact health‑check path, interval, timeout, and grace period are set per application in scalingo.json or the dashboard. A trivial /health endpoint that returns 200 while the application is still initializing can admit traffic prematurely.
scalingo.json) and record the exact endpoint, interval, timeout, and termination_grace_period_seconds.Health check passed, adding dyno to router — this confirms the gating moment.postdeploy runs; observe that the new dyno stays in “starting” state while old dynos keep serving.What is the current termination_grace_period_seconds value in your scalingo.json (or the default if unset)? This determines whether long‑lived HTTP requests and WebSocket frames have enough time to finish before SIGKILL.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.