Skip to content

Conversation

@conradludgate
Copy link
Contributor

Problem

I believe in all environments we now specify either required/rejected for proxy-protocol V2 as required. We no longer rely on the supported flow. This means we no longer need to keep around read bytes incase they're not in a header.

While I designed ChainRW to be fast (the hot path with an empty buffer is very easy to branch predict), it's still unnecessary.

Summary of changes

  • Remove the ChainRW wrapper
  • Refactor how we read the proxy-protocol header using read_exact. Slightly worse perf but it's hardly significant.
  • Don't try and parse the header if it's rejected.

@conradludgate conradludgate requested a review from a team as a code owner May 28, 2025 09:01
@conradludgate conradludgate requested a review from awarus May 28, 2025 09:01
@github-actions
Copy link

github-actions bot commented May 28, 2025

8525 tests run: 7942 passed, 0 failed, 583 skipped (full report)


Flaky tests (4)

Postgres 17

Postgres 16

Postgres 14

Code coverage* (full report)

  • functions: 32.2% (9020 of 28004 functions)
  • lines: 48.6% (80014 of 164757 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
6747124 at 2025-06-04T18:10:44.496Z :recycle:

@awarus
Copy link
Contributor

awarus commented May 28, 2025

LGTM in general, but we need to fix tests

@conradludgate conradludgate enabled auto-merge June 4, 2025 19:08
@conradludgate conradludgate added this pull request to the merge queue Jun 5, 2025
Merged via the queue into main with commit c8a96cf Jun 5, 2025
102 checks passed
@conradludgate conradludgate deleted the conrad/update-proxy-protocol-parsing branch June 5, 2025 07:19
skyzh pushed a commit that referenced this pull request Jun 6, 2025
## Problem

I believe in all environments we now specify either required/rejected
for proxy-protocol V2 as required. We no longer rely on the supported
flow. This means we no longer need to keep around read bytes incase
they're not in a header.

While I designed ChainRW to be fast (the hot path with an empty buffer
is very easy to branch predict), it's still unnecessary.

## Summary of changes

* Remove the ChainRW wrapper
* Refactor how we read the proxy-protocol header using read_exact.
Slightly worse perf but it's hardly significant.
* Don't try and parse the header if it's rejected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants