From: Junio C Hamano Date: Wed, 08 Jul 2026 20:02:46 GMT Subject: Re: [PATCH 2/3] t/lib-httpd: make http-429 first-request check atomic Message-ID: In-Reply-To: "Michael Montalbo via GitGitGadget" writes: > -# Check if this is the first call (no state file exists) > -if test -f "$state_file" > +# Apache can run this CGI for concurrent requests, so the script decides > +# whether this is the first call with a single atomic "mkdir": it succeeds for > +# exactly one of any racing requests and fails for the rest. "permanent" > +# always rate-limits and records no state. > +if test "$retry_after" != permanent && ! mkdir "$state" 2>/dev/null I think the last sentence in the above comment was meant to explain why the new code checks the value of "$retry_after", but it is not clear if it is needed for correctness (in other words, the original was wrong to do "test -f && touch" but also was wrong to do so even when "$retry_after" is set to "permanent), or if it is a mere "optimization opportunity" you are taking advantage of. In either case, it would be nice to see it explained in the proposed commit log message. Thanks.