Bump max_frame_size (#3050)

We use the WebSocket connection to send binary data (in the form of
shapefiles) from the engine to the client. These can very easily get
larger than the default 16MB limit on the max_frame_size. I don't
understand why it won't stich multiple frames together - but given what
I can see when this crashes, the max_message_size isn't the LIMFAC,
max_frame_size is.

That's an issue for future-us.

Signed-off-by: Paul Tagliamonte <paul@zoo.dev>
This commit is contained in:
Paul Tagliamonte
2024-07-17 15:32:57 -04:00
committed by GitHub
parent d30fbf8b4b
commit 2affc7271d
2 changed files with 15 additions and 2 deletions

View File

@ -137,7 +137,7 @@ After it runs you should just need the push the branch and open a PR.
The PR may then serve as a place to discuss the human-readable changelog and extra QA. The `make-release.sh` tool suggests a changelog for you too to be used as PR description, just make sure to delete lines that are not user facing. The PR may then serve as a place to discuss the human-readable changelog and extra QA. The `make-release.sh` tool suggests a changelog for you too to be used as PR description, just make sure to delete lines that are not user facing.
#### 2. Smoke test artifacs from the Cut Release PR #### 2. Smoke test artifacts from the Cut Release PR
The release builds can be find under the `artifact` zip, at the very bottom of the `ci` action page for each commit on this branch. The release builds can be find under the `artifact` zip, at the very bottom of the `ci` action page for each commit on this branch.

View File

@ -160,11 +160,24 @@ impl EngineConnection {
Ok(()) Ok(())
} }
#[allow(clippy::field_reassign_with_default)]
pub async fn new(ws: reqwest::Upgraded) -> Result<EngineConnection> { pub async fn new(ws: reqwest::Upgraded) -> Result<EngineConnection> {
// allowing the field_reassign_with_default lint here because the
// defaults for this object don't match the type defaults. We want
// to inherent the default config
//
// See the `impl Default for WebSocketConfig` in
// `tungstenite/protocol/mod.rs`
let mut wsconfig = tokio_tungstenite::tungstenite::protocol::WebSocketConfig::default();
// 4294967296 bytes, which is around 4.2 GB.
wsconfig.max_message_size = Some(0x100000000);
wsconfig.max_frame_size = Some(0x100000000);
let ws_stream = tokio_tungstenite::WebSocketStream::from_raw_socket( let ws_stream = tokio_tungstenite::WebSocketStream::from_raw_socket(
ws, ws,
tokio_tungstenite::tungstenite::protocol::Role::Client, tokio_tungstenite::tungstenite::protocol::Role::Client,
Some(tokio_tungstenite::tungstenite::protocol::WebSocketConfig { ..Default::default() }), Some(wsconfig),
) )
.await; .await;