Repository navigation
t/lib-httpd: fix apply-one-time-script race under concurrent requests - #156
Open
friel-openai wants to merge 2 commits into
Open
friel-openai wants to merge 2 commits into
friel-openai wants to merge 2 commits into
Conversation
apply-one-time-script.sh is a test helper that executes a "one-time-script" responsible for modifying the response normally returned by git-http-backend. apply-one-time-script.sh should run "one-time-script" once and return a modified response once. However, sometimes a race between multiple concurrent requests causes apply-one-time-script.sh to misbehave and return multiple modified responses or an empty response that results in: fatal: ... The requested URL returned error: 500 fatal: could not fetch <oid> from promisor remote This can be seen in the flaky failure of t5616.47 on the macOS CI runners. Fix the logic that checks if "one-time-script" has returned its modified response by chaining "rm one-time-script" with its execution. This ensures a racing script does not also have the opportunity to execute "one-time-script". Add t/t5567-one-time-script.sh to verify the race is fixed. Implement a stub "git-http-backend" that intentionally invokes a concurrent request, and check that only one modified response is returned without error. Signed-off-by: Michael Montalbo <[email protected]> Signed-off-by: Junio C Hamano <[email protected]> (cherry picked from commit 5945464) Signed-off-by: Frielbot <[email protected]>
friel-openai
marked this pull request as ready for review
October 21, 2026 22:45
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. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Concurrent requests to the
one_time_scripttest CGI can return an empty response after another request removesone-time-script. This causes intermittent HTTP 500 failures while a partial-clone fetch obtains a missing promisor delta base.Backport upstream 59454646906c, retaining its author and exact patch.
apply-one-time-script.shnow uses response files named for each process. A request serves a rewritten response only if rewriting changes its response and it successfully removesone-time-script; a losing request serves its original response. The upstreamt5567regression uses FIFOs to pause a passthrough request while a modifying request completes. Register it in Meson as well as Make.The observed failure is macOS Meson
t5616.50while validating #155. Apache recorded./one-time-script: No such file or directory, a second failed removal, and an empty CGI response. The failing fetch was still inindex-packwhile requesting a missing promisor base; #155 changes OID propagation afterdo_fetch_pack_v2()returns. The helper is byte-identical in #155, its public-master base andcodex, and its deterministic regression fails on the unchanged base. This is an existing fixture race, not a fetch-pack bookkeeping regression.The shared response files and removal after output originated in 3374292e5556 and were retained by the later Perl and shell conversions. Existing HTTP tests relied on the scheduler to overlap these requests.
t5567forces that overlap and checks complete, separate responses with empty stderr, preventing a passing run from hiding the same race.Validation: the new regression fails before the helper correction with the same missing-script and failed-removal errors, then passes after it. All 178 focused tests pass across
t5567, HTTP-enabledt5616,t5703,t5702andt5537; theDEVELOPER=1build andgit diff --checkpass. The stable patch ID matches upstream.This review-only topic starts from public
masteratb8242b093d9e941a34460d715e3ce616a34ac3feand targets generatedcodex. A separate commit retains the three exact reviewed CI workflow blobs accepted by the controller. No Git production code or repository format changes. No release or controller workflow is added to this topic.A CI-only combined candidate tests the same backport on
codexat9fe64f46bdef176eabbc4e7f1f15c8e4f8dbc325, including its existing HTTP authentication corrections. Candidateebacd2fa48a2e66e8831a78283aad471c4409315excludes release and controller workflows. This leaves the review topic's ancestry intact. Combined CI completed successfully: 45 jobs passed, two expected jobs were skipped, and none failed. The initial Fedora package-download failure passed on a focused retry of that job; no source change or successful-job rerun was needed. This validates the combined candidate; human review and normal controller staging remain required.Standalone source CI has the existing WebDAV and dumb-HTTP authentication failures:
t5540.18andt5550.15,.16, and.20. Logs for the SHA-256, breaking-changes, leaks, ASan/UBSan and Meson jobs confirm the same four failures. Standalone checks settled with 87 successes, seven expected skips and those five failed jobs. Those endpoints do not useapply-one-time-script.sh, and their source/tests are unchanged from this topic's base. The existing fixes in #126 and #142 are in the combinedcodexcandidate but absent from the standalone public-master ancestry. The newt5567regression andt5616pass in the failed jobs. The standalone matrix is not fully green.-frielbot
Codex Task:
codex://threads/01a1606c-756a-7150-8e8f-f8d37a933158