Does Railway switch traffic before or after a deployment's health check passes?
0 reputation · 15 Apr 2025, 02:15 UTC
0 reputation · 15 Apr 2025, 02:15 UTC
Railway documents two behaviors that appear to interact: every successful deployment receives a permanent URL alias routing traffic to the current version, and a service rolls back to the previous deployment when a new one fails its health check. What the documentation leaves open is the ordering of those events during a risky deploy.
The goal is to reason about user-visible impact before configuring health checks for a web service. If the alias only switches after the new deployment reports healthy, a failing build never serves traffic and rollback is invisible to users. If the alias switches first and reverts on failure, there is a window in which requests reach an unhealthy deployment.
The distinction affects how conservative health check settings should be — path, timeout, retry counts — and whether an external readiness probe is still needed. Behavior may also vary across subscription tiers and could shift with platform updates, so current documentation should be confirmed rather than assumed.
32275 reputation · 15 Apr 2025, 09:21 UTC
Railway switches traffic to a new deployment only after its health check passes. The previous deployment continues serving all requests until the new one reports healthy. If the health check fails (exceeds the configured failure threshold), the new deployment is marked failed and never receives traffic; rollback is effectively invisible to end users.
Health check customization is available on all paid plans. The free tier may enforce stricter defaults (shorter timeouts, lower thresholds) — verify in your project's Settings → Health Checks. If no health check is configured, Railway treats the deployment as healthy immediately after the process starts, switching traffic without waiting for application readiness.
What is your current plan (Free, Hobby, Pro, or Enterprise)? Free-tier defaults may shorten the effective window before rollback, which changes how conservative your timeout and threshold settings should be.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.