Skip to content

http-fetch: reuse completed packs before downloading - #148

Closed
dreynaud-oai wants to merge 1 commit into
codexfrom
dreynaud/reuse-packfile-uri
Closed

dreynaud-oai wants to merge 1 commit into
codexfrom
dreynaud/reuse-packfile-uri

Conversation

@dreynaud-oai

Copy link
Copy Markdown

No description provided.

A packfile URI can name a pack that is already installed locally.
We still download that pack because http-fetch only looks for a
partial download.

Open objects/pack/pack-<hash>.pack before starting HTTP. If we can open
it, feed it to the requested index-pack command and report zero
downloaded bytes. This preserves pack validation, index-pack output
and keep-file handling while avoiding a second download.

Signed-off-by: Daniel Reynaud <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T18:56:27.713675Z 92f766d PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 92f766d7fd

ℹ️ 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".

Comment thread http-fetch.c
report_packfile_progress(&progress);
if (run_command(&ip))
die("index-pack failed for existing pack");
return;

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 Clean up stale partial packs before returning

When a completed pack coexists with pack-<hash>.pack.temp—for example, after an interrupted download followed by another process installing the pack, or a crash after index-pack succeeds—the early return permanently bypasses the cleanup performed by finish_http_pack_request(). Every later invocation takes this branch as well, so a potentially multi-gigabyte partial remains in the object directory indefinitely; remove the obsolete temporary file after the existing pack has been successfully validated.

Useful? React with 👍 / 👎.

@dreynaud-oai

Copy link
Copy Markdown
Author

Superseded by #149 on dr/codex/reuse-packfile-uri. The commit is unchanged.

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