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@8c2562536b9f9f5291acaae113b0cab66767ec51Preview 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".
a8cc0a1 to
8c25625
Compare
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".
| const ownerFiles = entries.value.filter(isCacheLockOwnerFile); | ||
| if (ownerFiles.length === 0) { | ||
| if (isPastOwnerGrace) { | ||
| yield* removeEmptyDirectory(lockPath); |
There was a problem hiding this comment.
Tie lock reclamation to the observed directory
When a waiter stats an old lock, that lock can be removed and another contender can recreate lockPath before this call; because isPastOwnerGrace belongs to the old directory and the new contender may not have written its owner marker yet, this rmdir deletes the new lock and causes its marker write to fail with DownloadError (and StackPreparation to fall back to Docker). Fresh evidence beyond the earlier resolved thread is that the code captures the stale mtime before a separate readDirectory/rmdir sequence without verifying that the directory instance is unchanged; reclamation should atomically claim the observed lock rather than acting on the reused pathname.
Useful? React with 👍 / 👎.
| if (yield* isProcessAlive(ownerPid)) { | ||
| return; |
There was a problem hiding this comment.
Verify lock owners beyond their process ID
When a resolver is hard-killed and its PID is later reused, such as after a stale cache lock survives a reboot, process.kill(ownerPid, 0) succeeds for the unrelated process and this branch treats the abandoned lock as live. Subsequent resolutions repeatedly exhaust the lock retry window and return DownloadError or fall back to Docker until that unrelated process exits. Fresh evidence beyond the earlier abandoned-lock fix is that the uniquely named marker still records only a PID, with no process-start or boot identity to distinguish reuse; persist and verify such an identity before retaining the lock.
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