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

proxy: swap tungstenite for a simpler impl #7353

Merged
merged 12 commits into from
May 16, 2024
Merged

proxy: swap tungstenite for a simpler impl #7353

merged 12 commits into from
May 16, 2024

Conversation

conradludgate
Copy link
Contributor

@conradludgate conradludgate commented Apr 10, 2024

Problem

I wanted to do a deep dive of the tungstenite codebase. tokio-tungstenite is incredibly convoluted... In my searching I found fastwebsockets by deno, but it wasn't quite sufficient.

This also removes the default 16MB/64MB frame/message size limitation. framed-websockets solves this by inserting continuation frames for partially received messages, so the whole message does not need to be entirely read into memory.

Summary of changes

I took the fastwebsockets code as a starting off point and rewrote it to be simpler, server-only, and be poll-based to support our Read/Write wrappers.

I have replaced our tungstenite code with my framed-websockets fork.

https://github.com/neondatabase/framed-websockets

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 Apr 10, 2024

3084 tests run: 2957 passed, 0 failed, 127 skipped (full report)


Flaky tests (1)

Postgres 16

  • test_fixture_restart: debug

Code coverage* (full report)

  • functions: 31.5% (6349 of 20174 functions)
  • lines: 47.5% (47926 of 100928 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
a8e45d1 at 2024-05-15T15:24:34.392Z :recycle:

@conradludgate conradludgate marked this pull request as ready for review May 15, 2024 12:46
@conradludgate conradludgate requested a review from a team as a code owner May 15, 2024 12:46
@conradludgate conradludgate enabled auto-merge (squash) May 15, 2024 14:14
@conradludgate conradludgate merged commit 790c05d into main May 16, 2024
56 checks passed
@conradludgate conradludgate deleted the fastwebsockets branch May 16, 2024 11:05
a-masterov pushed a commit that referenced this pull request May 20, 2024
## Problem

I wanted to do a deep dive of the tungstenite codebase.
tokio-tungstenite is incredibly convoluted... In my searching I found
[fastwebsockets by deno](https://github.com/denoland/fastwebsockets),
but it wasn't quite sufficient.

This also removes the default 16MB/64MB frame/message size limitation.
framed-websockets solves this by inserting continuation frames for
partially received messages, so the whole message does not need to be
entirely read into memory.

## Summary of changes

I took the fastwebsockets code as a starting off point and rewrote it to
be simpler, server-only, and be poll-based to support our Read/Write
wrappers.

I have replaced our tungstenite code with my framed-websockets fork.

<https://github.com/neondatabase/framed-websockets>
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