Repository navigation
Stop the admission probe decoding output it never reads, and guard the large non-UTF-8 diff [patch] - #82
Open
matt-edmondson wants to merge 1 commit into
Open
Stop the admission probe decoding output it never reads, and guard the large non-UTF-8 diff [patch]#82matt-edmondson wants to merge 1 commit into
matt-edmondson wants to merge 1 commit into
Conversation
…e large non-UTF-8 diff [patch] The ls-remote admission probe only asks whether git succeeded, yet its output was decoded as strict UTF-8, so one branch name git allows but UTF-8 cannot read refused every caller of the repository. GitInvocation gains DiscardStandardOutput: the output is still drained, but thrown away undecoded, and standard error, which classifies a refusal, is kept. The probe sets it. The diff-tree stall itself no longer reproduces: git invocation now goes through ktsu.RunCommand 1.9.5, which kills the command and rethrows when a read fails (ktsu-dev/RunCommand#89). A regression test with a non-UTF-8 path ahead of 200 KB of output now guards that it stays reported as "not valid UTF-8" rather than a timeout. Fixes #50 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016rdMXULeUT13t6FCwNfocx
|
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.



Fixes #50
What changed
GitInvocation.DiscardStandardOutput: when set,GitRunnerstill drains standard output but throws it away without decoding it. Standard error is kept and decoded leniently, because it is only shown and searched for git's own ASCII messages.AdmissionGatesets this flag on itsls-remote --headsprobe. A reachable repository with a non-UTF-8 branch name is now admitted, instead of every caller gettingnot-admitted, or a 504 when the bad name is followed by more than a pipe of refs.The diff-tree stall
This half of the issue no longer reproduces on
main. Since #27,GitRunnerruns git throughktsu.RunCommand1.9.5, which kills the command and rethrows when a read fails (ktsu-dev/RunCommand#89, fixed by RunCommand#96). This PR adds a regression test for it: a non-UTF-8 path followed by 200 KB of output must come back as "not valid UTF-8" well inside the timeout, withTimedOut == false. That test already passes without the source change here. It guards against the bug returning, for example through a RunCommand downgrade.Tests
New tests:
GitRunnerTests.RunAsync_OutputThatIsNotUtf8AndLargerThanThePipe_IsReportedPromptlyRatherThanAsATimeoutGitRunnerTests.RunAsync_DiscardingStandardOutput_SucceedsWhateverTheOutputHoldsGitRunnerTests.RunAsync_DiscardingStandardOutput_StillReportsStandardErrorAdmissionGateTests.AdmitAsync_DiscardsTheProbesOutputWith the
GitRunner/AdmissionGatechanges reverted,…SucceedsWhateverTheOutputHoldsandAdmitAsync_DiscardsTheProbesOutputfail. With the changes in place, the full suite passes (247/247, Linux).🤖 Generated with Claude Code
https://claude.ai/code/session_016rdMXULeUT13t6FCwNfocx
Generated by Claude Code