Forward to a peer when the local upstream connect fails on a TLS-terminating failover route
Los mantenedores suelen responder en 1 día
@kriszyp ya está trabajando en esto.
Desde el 5/11/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
On a TLS-terminating route with peer failover, the first connections after the local upstream stops are still dropped. Forward a connection to a peer when its local upstream connect fails (#79), fixed by #81, covers only passthrough routes. That was meant to be every Fabric route, but it isn't.
Observed (symphony 1.6.0, two-node Fabric stage cluster, Harper 5.3.5)
On Harper versions with per-thread Unix sockets, host-manager configures every failover route (443, 9925, 9926, 8883) as terminateTls: true with a uds upstream. Passthrough is used only for TCP upstreams (older Harper versions).
The local Harper container was stopped, and 2 s later a TLS connection went to 9926. It was dropped after 6 ms, counted as upstream_connect, with no forward to the peer. The connections after it were forwarded, because that failure had marked the slot refusing.
symphony 1.7.1 behaves the same on these routes: #81's forward runs only in the passthrough branch of handle (src/proxy_conn.rs).
Cause
A TLS-terminating route completes the client handshake (tls_accept) before proxy_via_tls connects upstream. Once the handshake has consumed the ClientHello, the connection can no longer be replayed raw to a peer's failoverIngress. failover::decide() runs before the handshake but forwards only a route already marked down.
Proposed change
On a TLS-terminating failover route, on a client listener, not suspended: connect upstream before the TLS handshake. If the connect fails, forward the untouched hello with forward_to_peers (ForwardMode::Down) exactly as #81 does for passthrough. If it succeeds, hand the connected upstream to proxy_via_tls after the handshake. A Unix-socket connect costs well under 1 ms, so the extra latency is negligible.
The open design question is h1 vs h2. proxy_via_tls picks destination or destination_h2 from the ALPN the handshake negotiates, which isn't known before the handshake. Options:
- Predict the negotiated protocol from the ClientHello's ALPN offer and the route's
ServerConfigALPN list (rustls picks by server preference), then connect to that destination. If the handshake negotiates something else, connect the other destination afterward, as today. - Probe both destinations with a connect-and-close before the handshake, then connect for real afterward. Simpler, but adds an extra accept and close on Harper for every connection.
- Connect the h1 destination first and keep it only when h1 is negotiated.
Prefer option 1 unless the investigation shows a problem with it.
Constraints:
- Keep the per-connection future within its 4 KiB budget (
the_per_connection_future_stays_within_budget). AnUpstreamStreamheld across the handshake may need boxing. - Reuse #81's budget handling: a local connect capped at half of
hs_timeout, and peers get the remainder. upstream_connectaccounting stays the same as #81.
Tests
- TLS-terminating route with a peer, local UDS refusing and not yet marked down: the first connection is served by the peer. This test fails on 1.7.1.
- Same with a stale socket file (no listener) and with a missing socket file.
- An h2-offering client on a route with
destination_h2: the correct destination is used. - All peers refuse: the client is closed, and
upstream_connectis counted. - Ingress listener and suspended routes: unchanged.
Found during Fabric stage failover testing. — Claude Opus 5.5, drafted with Kris
- Lenguaje dominante
- Rust
- Estrellas
- 1
- Forks
- 0
- Merge medio
- 19 h 12 min
- PR fusionados (30 d)
- 13
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de HarperFast/symphony
-
Don't route to a restarted upstream until it serves, not just acceptsPosiblemente ocupada @kriszyp la tomó hace 5 días. Abierto
HarperFast/symphony#84 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
HarperFast/symphony#80 ·
Los mantenedores suelen responder en 1 día
-
Forward a connection to a peer when its local upstream connect failsPosiblemente ocupada @kriszyp la tomó hace 5 días. Abierto
HarperFast/symphony#79 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
HarperFast/symphony#77 ·
Los mantenedores suelen responder en 1 día
-
Spill a share of new connections to a less-loaded peer when local Harper threads are busyPosiblemente ocupada @kriszyp la tomó hace 12 días. Abierto
HarperFast/symphony#73 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de HarperFast/symphony
Issues similares
-
area: cli kind:docs priority: P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
swc-project/swc-ai-issues#164 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
pop-os/cosmic-player#367 ·
-
good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
servo/rust-smallvec#873 ·