fix(git): prepare cold snapshot misses in background - #409
Conversation
f81ed83 to
e32d46b
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
e32d46b to
6c648eb
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6c648ebcc4
ℹ️ 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".
6c648eb to
2368496
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 236849658e
ℹ️ 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".
2368496 to
c1adb34
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c1adb34197
ℹ️ 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".
| } | ||
| case errors.Is(err, os.ErrNotExist): | ||
| if _, preparing := s.mirrorPreparations.Load(upstreamURL); preparing { | ||
| http.Error(w, "Repository unavailable", http.StatusServiceUnavailable) |
There was a problem hiding this comment.
I see that this was already the status used above for a similar case but maybe 404 (with Cache-Control: no-store) is a more appropriate response? That's what HEAD requests will get so GET being different is weird. Also I'm pretty sure clients of cachew will auto-retry 5xx errors, which in this case are very unlikely to succeed.
Co-authored-by: Codex <noreply@openai.com> Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a0a667-aa3c-7519-8f18-52fce84e7724
c1adb34 to
3756fe2
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3756fe2e7b
ℹ️ 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".
| // snapshotGenRecord stores the generation state for each artifact. | ||
| // ClaimID identifies the owner for release and completion checks. | ||
| // ClaimExpiresAt gives all replicas the same expiration time. |
There was a problem hiding this comment.
Remove the short snapshot record commentary
This three-line comment merely restates what the fields of an unexported, seven-field struct represent; it is neither documentation for a public symbol nor an explanation of why a non-obvious 20+ line block exists. Remove it and rely on the field names, or replace it only with rationale that satisfies the repository's explicit commenting policy.
AGENTS.md reference: AGENTS.md:L19-L22
Useful? React with 👍 / 👎.
On a cold snapshot miss, Cachew returns HTTP 404 with
Cache-Control: no-store. The client can then use a normal Git clone.Cachew prepares the snapshot in a background job. The job continues after the client disconnects. Queue limits and timeouts limit resource use. Shared claims reduce duplicate work across replicas, but they do not prevent all duplicates.
The first periodic base snapshot waits one full interval after cold preparation ends, including failed uploads. This change does not alter client refresh checks.
Generated with Amp