Repository navigation
Backend: the zero-copy reader evicts the connection still borrowing the host buffer - #6356
Merged
Merged
Conversation
…he host buffer The read buffer is per host, and advance() privatised a connection that stopped mid-request only if it could find it by descriptor afterwards. A pipelined pair still came back 400 duplicate Host header on CI. Before a zero-copy read, a different connection still borrowing the buffer now gets its own copy, whatever path switched it out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
BackendHttpIntegrationTest.bodilessStatusDoesNotDesyncTheConnectionfailed on CI with its first reply400 duplicate Host header. A pipelined request had been parsed out of bytes that another connection's read wrote into the same per-host zero-copy buffer.Until now,
advance()privatised the buffer of a connection that stopped mid-request, but only when it could find that connection again by descriptor after the switch. With this change the reader evicts: before a zero-copy read, a different connection that is still borrowing the host's buffer is given its own copy first (VtHost.borrower,Conn.evictOtherBorrower). That holds whatever path switched the connections. It copies only when two connections actually overlap, and zero-copy reads stay on.Tests:
BackendHttpIntegrationTest, run locally: 79 tests, 0 failures, 1 skipped.The race never reproduced locally, either before or after the fix. Neither run proves the fix, and this PR has no reproducing test.
🤖 Generated with Claude Code