Repository navigation
Conversation
A concurrent `stop`, `stop --all`, or rollback could prune a project's Docker network between `start` creating it and attaching the first container, failing `start` with "network ... not found". `start`, `db start` (including declarative auto-start), and `stop` now hold a cross-process lifecycle lock under `$SUPABASE_HOME/locks`: a per-project lock keyed by the project's Docker label, behind a shared gate that `stop --all` takes exclusively. A blocked command prints one waiting line and gives up after 10 minutes.
Contributor
There was a problem hiding this comment.
🤖 AI Review
Verified all three Claude findings and confirmed them as nits: one misleading waiting message and two documentation gaps. Codex reported no findings. No functional defect was established. Tests were not run; dependencies are absent from the checkout.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| ⚪ NIT | apps/cli/src/command-internal/project-lifecycle-lock.ts:131 |
ux |
claude | When stop --all blocks the shared gate, the waiting message describes project-specific contention, while the eventual timeout correctly identifies an all-projects stop. |
| ⚪ NIT | apps/cli/src/commands/start/SIDE_EFFECTS.md:231 |
documentation |
claude | The start, db start, and stop exit-code tables document ProjectLifecycleLockBusyError but omit the new ProjectLifecycleLockIoError failure. |
| ⚪ NIT | packages/stack/src/effect.ts:92 |
documentation |
claude | The isLockBusy documentation mentions only holdLock even though the helper also classifies failures from holdSharedLock and holdExclusiveLock. |
Stats
Claude findings: 3 · Codex findings: 0 · Confirmed: 3 · Refuted: 0 · Uncertain: 0
Models: claude-opus-5-5 + gpt-6.1-sol · Trigger: auto · Workflow run
This review runs once per PR. A maintainer can request another with a /ai-review comment.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #7339
Problem
Between
startcreating a project's Docker network and attaching its first container, the network has no endpoints. Any project-label-filtereddocker network prunethat lands in that window removes it, andstartthen fails withnetwork supabase_network_<id> not found. Within one invocation every prune runs before bring-up (stopped-stack recovery) or after it stops (rollback), so the prune in the report most likely came from an overlapping lifecycle command on the same project: an earlierstartstill rolling back, astop,stop --all, or adb startrollback.Change
start,db start(including the declarative auto-start), andstophold a cross-process lifecycle lock under$SUPABASE_HOME/locks:project_idserialize and different projects still run in parallel;stop --allholds exclusively.@supabase/stackgainsholdSharedLock/holdExclusiveLocknext toholdLock.ensureNetworkdoc comment no longer claims the network cannot be removed mid-run.Limitations
Older CLI binaries, raw
dockercommands, a differentSUPABASE_HOME, and projects sharing a custom--network-iddo not participate, andstop --allis not queued ahead of a stream of single-project commands (documented instart'sSIDE_EFFECTS.md).db resetand the shadow database still create their network without the lock; that is a separate follow-up.