You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dev-docs/PEGBOARD_TUNNEL_RETRIES.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ This document explains how retries are coordinated between Guard and Pegboard-ba
7
7
## HTTP
8
8
9
9
- Signal: A retryable transient tunnel failure is signaled by returning an HTTP 503 with the `X-RIVET-ERROR` header set.
10
-
- Example (Pegboard Gateway): on tunnel closed (e.g., UPS `no_responders` or `request_timeout`), the gateway replies with `503` and `X-RIVET-ERROR: pegboard_gateway.tunnel_closed`.
10
+
- Example (Pegboard Gateway): on tunnel closed (e.g., UPS `request_timeout`), the gateway replies with `503` and `X-RIVET-ERROR: pegboard_gateway.tunnel_closed`.
11
11
12
12
- Guard behavior
13
13
- Guard considers a response retryable if `status == 503` and the `X-RIVET-ERROR` header is present.
@@ -37,7 +37,7 @@ This section explains how WebSocket retries are coordinated between Guard and Pe
37
37
- Handler contract:
38
38
- Do not await the client websocket yet.
39
39
- Return the untouched `HyperWebsocket` in the error tuple so Guard still owns it: `Err((client_ws, err))`.
40
-
- The outer wrapper maps tunnel-closed UPS errors (e.g., `ups.no_responders`, `ups.request_timeout`) to `WebSocketServiceUnavailable`.
40
+
- The outer wrapper maps tunnel-closed UPS errors (e.g., `ups.request_timeout`) to `WebSocketServiceUnavailable`.
41
41
- Guard reaction:
42
42
- Treats `WebSocketServiceUnavailable` as retryable.
43
43
- Re-resolves the route with ignore-cache=true, using middleware-config retry/backoff.
@@ -65,7 +65,7 @@ This section explains how WebSocket retries are coordinated between Guard and Pe
65
65
- Return the socket in the error tuple: `Err((client_ws, err))`.
66
66
67
67
- Map tunnel-closed errors at the wrapper:
68
-
- In the outer `handle_websocket` wrapper, detect tunnel-closed (e.g., `ups.no_responders`, `ups.request_timeout`) and map to `WebSocketServiceUnavailable`.
68
+
- In the outer `handle_websocket` wrapper, detect tunnel-closed (e.g., `ups.request_timeout`) and map to `WebSocketServiceUnavailable`.
69
69
-`handle_websocket_inner` should return raw errors; do not construct `WebSocketServiceUnavailable` inside the inner function.
70
70
71
71
- Use `ups.request` for all tunnel operations (open, messages, close):
0 commit comments