-
Notifications
You must be signed in to change notification settings - Fork 131
fix(guard): add cache clearing to ws retry, increase ws retries #2448
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
fix(guard): add cache clearing to ws retry, increase ws retries #2448
Conversation
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR enhances WebSocket connection reliability in the guard service by modifying retry behavior and cache management.
- Increased WebSocket retry attempts from 4 to 7 and decreased initial interval from 250ms to 150ms in
packages/edge/infra/guard/server/src/main.rs - Added cache clearing during WebSocket retries in
packages/edge/infra/guard/core/src/proxy_service.rsto ensure fresh routing on retry - Made target parameter mutable in
handle_websocket_upgradeto allow route updates during retries - Removed outdated comments about retry configuration
2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
| match new_target { | ||
| Ok(ResolveRouteOutput::Target(new_target)) => { | ||
| target = new_target; | ||
| } | ||
| Ok(ResolveRouteOutput::Response(_response)) => { | ||
| error!("Expected target, got response") | ||
| } | ||
| Err(e) => error!("Routing error: {}", e), | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Should propagate routing errors to client with appropriate close code rather than just logging
| match new_target { | |
| Ok(ResolveRouteOutput::Target(new_target)) => { | |
| target = new_target; | |
| } | |
| Ok(ResolveRouteOutput::Response(_response)) => { | |
| error!("Expected target, got response") | |
| } | |
| Err(e) => error!("Routing error: {}", e), | |
| } | |
| match new_target { | |
| Ok(ResolveRouteOutput::Target(new_target)) => { | |
| target = new_target; | |
| } | |
| Ok(ResolveRouteOutput::Response(_response)) => { | |
| error!("Expected target, got response"); | |
| // Send close with internal error code | |
| let _ = client_sink.send(hyper_tungstenite::tungstenite::Message::Close(Some( | |
| hyper_tungstenite::tungstenite::protocol::CloseFrame { | |
| code: 1011.into(), // Internal error | |
| reason: "Routing error: unexpected response".into(), | |
| } | |
| ))).await; | |
| return; | |
| } | |
| Err(e) => { | |
| error!("Routing error: {}", e); | |
| // Send close with internal error code | |
| let _ = client_sink.send(hyper_tungstenite::tungstenite::Message::Close(Some( | |
| hyper_tungstenite::tungstenite::protocol::CloseFrame { | |
| code: 1011.into(), // Internal error | |
| reason: format!("Routing error: {}", e).into(), | |
| } | |
| ))).await; | |
| return; | |
| } | |
| } |
Deploying rivet with
|
| Latest commit: |
63e9908
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5088259b.rivet.pages.dev |
| Branch Preview URL: | https://graphite-base-2446.rivet.pages.dev |
5ae1f6e to
63e9908
Compare
Deploying rivet-studio with
|
| Latest commit: |
63e9908
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ee92d214.rivet-studio.pages.dev |
| Branch Preview URL: | https://graphite-base-2446.rivet-studio.pages.dev |
Deploying rivet-hub with
|
| Latest commit: |
63e9908
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c2b17a1c.rivet-hub-7jb.pages.dev |
| Branch Preview URL: | https://graphite-base-2446.rivet-hub-7jb.pages.dev |
Merge activity
|
<!-- Please make sure there is an issue that this PR is correlated to. --> ## Changes <!-- If there are frontend changes, please include screenshots. -->

Changes