Free trial · 14 days · Cancel anytimeGet started

Critical fix (found in production testing, Wheelrn migration): a blue/green deployment…

v0.20.1-beta
  • Critical fix (found in production testing, Wheelrn migration): a blue/green deployment could surface a ghost instance, with an inconsistent X/1 active and intermittent 502s for several tens of seconds. Two compounding bugs in deploy_app.go:

1. Identifying a deployment's "already in place" containers did a plain strings.Contains on the app slug, without scoping it to the project. On this shared "Pierrr-self" agent (which hosts client projects as well as the Hub's own dogfooded apps), a client app slug like landing also matched pier-hub-landing-1 (the unrelated internal Hub app) — wrongly inflating the count of "old" instances and scaling to 2 replicas a deployment that should have created only one. Matching is now anchored on <project>-<app>-<index>, never a free substring.

2. The swap's health gate (waitHealthy) compared docker ps ids truncated to 12 characters against a map indexed by the full id docker inspect returns — the lookup therefore missed systematically, silently treating every new replica as "ready" without ever checking its real HEALTHCHECK status. Fixed by reusing the same prefix-resolution mechanism already in place elsewhere in the agent (health_snapshot.go, topology_snapshot.go), now shared through docker.ResolveShortID.