Repository navigation
Accept Broken pipe in ExceptionContractFixture rejected-connection test - #737
Merged
sburmanoctopus merged 1 commit intoNov 16, 2026
Merged
Conversation
On Linux, when the port forwarder kills the connection, the client can
write to a socket the peer has already reset and get EPIPE ("Broken pipe")
instead of the read/write/EOF errors already accepted. Halibut still
throws the expected HalibutClientException before the request begins, so
accept this wording too.
Fixes LEV-2086
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
akirayamamoto
approved these changes
Nov 16, 2026
There was a problem hiding this comment.
LGTM, thanks for unblocking the builds.
One small thing for the description: "IsNetworkError still classifies it as a network error" isn't always true. If the pipe breaks during the Halibut handshake, the error gets wrapped in ConnectionInitializationFailedException, and IsNetworkError doesn't look inside it, so it returns UnknownError. I confirmed this with a quick unit test.
It doesn't look like this affects users though. Tentacle client still retries UnknownError, and Server metrics count it as a network failure. The only difference I could find is the label in a Server warning log.
Possible follow-ups, both low priority:
- If this keeps flaking, we could assert only the exception type and the "before the request could begin" prefix, and drop the error text after it. The test can't control exactly how the connection fails, so it probably shouldn't assert on it.
- If someone is in that code anyway,
IsNetworkErrorcould check what's insideConnectionInitializationFailedException.
(Disclaimer: I found and explored this with Claude, so worth a second look.)
sburmanoctopus
deleted the
levi/accept-broken-pipe-in-exception-contract
branch
November 16, 2026 21:33
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.
Background
ExceptionContractFixture.WhenTheListeningRequestFailsToBeSent_AsTheServiceRejectsTheConnection_AHalibutClientExceptionShouldBeThrownfails now and then on Linux. It has failed twice so far, most recently in Linux test 25132807, and that failure blocked both the Full Chain and Nightly builds.The test gets the expected
HalibutClientException, but the message ends inBroken pipe. That message isn't in the list the test accepts.Results
Fixes LEV-2086
When the port forwarder kills the connection, the client can write to a socket the peer has already reset. When that happens on Linux, the error is EPIPE ("Broken pipe") rather than the read/write/EOF errors the test already accepts. Halibut is behaving correctly: it throws the right exception type, marked as failing before the request could begin. Only the test needs to change.
This PR adds
Broken pipeto the messages the test accepts, the same way #710 added the Windows connect-timeout message.🤖 Generated with Claude Code