Health check failure: Cloud Run revision upgrade recovery
0 reputation · 13 Mar 2025, 03:48 UTC
0 reputation · 13 Mar 2025, 03:48 UTC
Safely recover from a Cloud Run revision that fails health checks after an upgrade, ensuring minimal service disruption and preserving request integrity.
Cloud Run’s traffic‑splitting feature allows a new revision to receive a percentage of traffic, but the platform does not automatically revert traffic to the previous revision when health checks fail. Operators must manually adjust traffic weights via the console or gcloud, and there is no built‑in alert that forces a rollback. This lack of automatic rollback can expose services to prolonged failure periods if operators overlook manual intervention.
If you deploy a revision that is returning 5xx errors or failing startup probes, follow these steps to restore service stability:
gcloud run revisions list --service [SERVICE_NAME]
gcloud run services update-traffic [SERVICE_NAME] --to revisions=[STABLE_REVISION_NAME]Cloud Run's traffic splitting allows for canary releases, but the platform treats the traffic assignment as the desired state. If a revision is assigned 10% of traffic and fails health checks, the platform maintains that 10% assignment while reporting errors. There is no native "circuit breaker" that triggers a traffic weight shift based on instance health check status alone.
To avoid manual intervention in the future, consider these architectural shifts:
run.googleapis.com/request_count filtered by response_code >=500 to notify operators immediately when an upgrade fails.Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.