fix(stack): harden service artifact resolution - #6041
Conversation
5cb141b to
39d03a3
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 39d03a3e68
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Supabase CLI previewnpx --yes https://pkg.pr.new/supabase/cli/supabase@f2a6ae5a84225a13e2af219b8c2272456f980f1aPreview package for commit |
39d03a3 to
3bdb698
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3bdb698f60
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
3bdb698 to
a8cc0a1
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a8cc0a111e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
8c25625 to
462a1fb
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 462a1fbe91
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
462a1fb to
beda5f5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: beda5f5a31
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
beda5f5 to
4fba440
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4fba440168
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
4fba440 to
a66d82d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a66d82d22d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
23ccff4 to
f2a6ae5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f2a6ae5a84
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const CACHE_LOCK_OWNER_PREFIX = "owner."; | ||
| const CACHE_LOCK_OWNER_GRACE_MS = 5_000; | ||
| const STALE_STAGING_AGE_MS = 24 * 60 * 60 * 1_000; | ||
| const CACHE_LOCK_RETRY_SCHEDULE = Schedule.spaced("100 millis"); |
There was a problem hiding this comment.
Bound retries when stale locks cannot be reclaimed
When a stale lock cannot be quarantined—for example because the cache parent became read-only or Windows keeps a handle open—the rename failure at line 380 is discarded, acquire emits CacheLockBusy, and this unbounded Schedule.spaced retries forever instead of producing a DownloadError that permits Docker fallback. Fresh evidence beyond the resolved active-owner thread is that failed reclamation uses the same schedule as a verified live owner, with no retry limit or liveness distinction; keep indefinite polling only for live owners and bound persistent reclamation failures.
Useful? React with 👍 / 👎.
| return service === "postgres" | ||
| ? [executable, `${directory}/share/supabase-cli/bin/supabase-postgres-init.sh`] | ||
| : [executable]; |
There was a problem hiding this comment.
Validate all Postgres executables before reusing legacy caches
When an interrupted provider-less Postgres extraction contains bin/postgres and the init script but is missing other runtime files, this accepts it before attempting a replacement download. Fresh evidence beyond the earlier legacy-payload thread is that services/postgres.ts executes bin/pg_isready and services/postgres-init.ts executes bin/psql, neither of which is checked here; the resolution therefore succeeds as native and later fails during startup rather than allowing Docker fallback. Require every executable needed by the native service before returning the legacy directory.
Useful? React with 👍 / 👎.
| return ( | ||
| owner.startIdentity === undefined || | ||
| processStartIdentity(owner.pid) === owner.startIdentity | ||
| ); |
There was a problem hiding this comment.
Keep live owners when start-identity lookup is unavailable
On platforms where process-start lookup transiently fails, such as a PowerShell timeout on Windows or a ps failure on macOS, process.kill(pid, 0) has already established that the PID is live but comparing the resulting undefined identity with the persisted value returns false. The reclaimer can then quarantine an active owner's lock and admit another owner while the first continues downloading, allowing both to remove and publish the same cache directory concurrently. Fresh evidence beyond the resolved PID-generation threads is that an unavailable lookup is treated as an identity mismatch rather than an inconclusive check; conservatively retain the live owner until its identity can be verified.
Useful? React with 👍 / 👎.
Stack layer 1 of 7.
Rebuilds the non-Fleet artifact foundation from #5819 as a focused change:
Fleet remains out of scope for this stack.
Stack: #6041 → #6042 → #6043 → #6044 → #6045 → #6046 → #6047
Supersedes #5819