Repository navigation
fix(electric): stop restarting Electric on unrelated deploys - #1457
Conversation
alchemy hashes a Dockerfile build context together with bun.lock, so any dependency change retagged the Electric image and restarted the singleton task. On 2026-10-14 two back-to-back PRD deploys (one landing-only) each caused a ~2 min sync outage this way. The Dockerfile was a single pinned FROM, so pass that ref as `image`: alchemy mirrors it to ECR under a tag derived from the ref and platform only, and Electric restarts only when the pin changes. The deploy that ships this restarts it once more, since the tag scheme changes.
Maple review🟢 Confidence 8/10 · likely safe to merge Electric stops being built from a Dockerfile context and is instead handed to the ECS service as the same pinned ghcr ref, so a
Before merge
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
Merged with 1 step from "Before merge" still open. If it is done, tick it on the review comment; if not, now is the time.
|
Problem
Every PRD deploy that touches
bun.lockrestarts Electric. alchemy names a context-built image after a hash of the context plus the repo lockfile, so an unrelated dependency change gives Electric a new image tag, a new task definition and a restart. Electric is a singleton (minimumHealthyPercent: 0), so each restart is a sync gap.On 2026-10-14 this happened twice in a row: the deploys for #1450 and #1456 (a landing-only change) each caused ~2 min of 503s from the load balancer, about 130 failed shape requests across dashboards and the alerts lists. The three latest task definitions differ only in image tag.
Fix
apps/electric/Dockerfilewas a single pinnedFROM. Pass that ref to the ECS service asimageinstead: alchemy mirrors it into ECR under a tag hashed from the ref and platform only, so Electric restarts only when the pin changes. The Dockerfile is gone; the pin and its rationale now live inELECTRIC_IMAGEinapps/electric/alchemy.run.ts, and the publish workflow and runbook point there.The deploy that ships this restarts Electric once more (the tag scheme changes), then it stays put.
apps/ingestandapps/sandboxalso build from contexts and likely restart on lockfile changes too; not touched here.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit