Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reduce complexity of proxy protocol parse #7078

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

conradludgate
Copy link
Contributor

@conradludgate conradludgate commented Mar 9, 2024

Problem

The WithClientIp AsyncRead/Write abstraction never filled me with much joy. I would just rather read the protocol header once and then get the remaining buf and reader.

Summary of changes

  • Replace WithClientIp::wait_for_addr with read_proxy_protocol.
  • Replace WithClientIp with ChainRW.
  • Optimise ChainRW to make the standard path more optimal.

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.
  • Do we need to implement analytics? if so did you add the relevant metrics to the dashboard?
  • If this PR requires public announcement, mark it with /release-notes label and add several sentences in this section.

Checklist before merging

  • Do not forget to reformat commit message to not include the above checklist

Copy link

github-actions bot commented Mar 9, 2024

2772 tests run: 2654 passed, 0 failed, 118 skipped (full report)


Flaky tests (1)

Postgres 16

  • test_compute_pageserver_connection_stress: release

Code coverage* (full report)

  • functions: 28.1% (6461 of 23024 functions)
  • lines: 46.8% (45616 of 97518 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
0d0fba1 at 2024-04-22T15:36:26.877Z :recycle:

@conradludgate conradludgate force-pushed the hyper1-only-proxy branch 9 times, most recently from 5d74dad to e1a7a58 Compare March 15, 2024 12:24
@conradludgate conradludgate force-pushed the hyper1-only-proxy branch 2 times, most recently from 3c74049 to c525249 Compare April 9, 2024 14:50
Base automatically changed from hyper1-only-proxy to main April 10, 2024 08:24
@conradludgate conradludgate marked this pull request as ready for review April 22, 2024 14:59
@conradludgate conradludgate requested a review from a team as a code owner April 22, 2024 14:59
proxy/src/proxy.rs Show resolved Hide resolved
proxy/src/protocol2.rs Show resolved Hide resolved
proxy/src/protocol2.rs Show resolved Hide resolved
@conradludgate conradludgate merged commit cdccab4 into main Apr 25, 2024
54 checks passed
@conradludgate conradludgate deleted the proxy-simplify-proxy-protocol branch April 25, 2024 10:14
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.

None yet

2 participants