Skip to content

fix(git): stage parallel snapshot temp file on target filesystem#363

Merged
alecthomas merged 1 commit into
mainfrom
aat/parallel-snapshot-temp-fs
Jun 26, 2026
Merged

fix(git): stage parallel snapshot temp file on target filesystem#363
alecthomas merged 1 commit into
mainfrom
aat/parallel-snapshot-temp-fs

Conversation

@alecthomas

Copy link
Copy Markdown
Collaborator

Parallel restore wrote the whole compressed snapshot to the default temp
dir, which can fail with ENOSPC on hosts where /tmp is a small or
separate tmpfs even when the target directory has room. Stage it under
the target directory's parent (same filesystem, created if missing)
instead. Add an end-to-end parallel restore test covering this.

@alecthomas alecthomas requested a review from a team as a code owner June 26, 2026 01:39
@alecthomas alecthomas requested review from jrobotham-square and removed request for a team June 26, 2026 01:39
@alecthomas alecthomas enabled auto-merge (squash) June 26, 2026 01:39
Parallel restore wrote the whole compressed snapshot to the default temp
dir, which can fail with ENOSPC on hosts where /tmp is a small or
separate tmpfs even when the target directory has room. Stage it under
the target directory's parent (same filesystem, created if missing)
instead. Add an end-to-end parallel restore test covering this.
@alecthomas alecthomas force-pushed the aat/parallel-snapshot-temp-fs branch from 3ba2583 to 83f41d3 Compare June 26, 2026 01:40

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3ba2583fb5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread cmd/cachew/git.go
if err := os.MkdirAll(tmpDir, 0o750); err != nil {
return "", "", errors.Wrap(err, "create snapshot temp dir")
}
tmp, err := os.CreateTemp(tmpDir, ".cachew-snapshot-*.tar.zst")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid requiring writes to the restore parent

When Directory already exists and is writable but its parent is not (for example a CI workspace pre-created/chowned for the job under a root-owned parent), snapshot.Extract can succeed because it only needs to write inside c.Directory, but this new CreateTemp writes into filepath.Dir(c.Directory) and fails the parallel restore before extraction with permission denied. Consider staging in the existing target directory, or falling back when the parent cannot be written, while still keeping the temp file on the target filesystem.

Useful? React with 👍 / 👎.

@alecthomas alecthomas disabled auto-merge June 26, 2026 01:41
@alecthomas alecthomas merged commit 8f32327 into main Jun 26, 2026
7 checks passed
@alecthomas alecthomas deleted the aat/parallel-snapshot-temp-fs branch June 26, 2026 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant