Commit e4fc66d
committed
Improve websocket liveness checks and idle timeout handling
- Idle timeout no longer requires receive activity alone: the send loop
extends the idle deadline whenever it makes write progress
(rate-limited to once per second).
- On idle timeout, initiate a proper close handshake carrying an
"idle timeout" reason instead of abruptly tearing down the
connection, so well-behaved clients can tell why they were
disconnected. The connection is torn down if the handshake does not
complete within a 10s grace period.
- Dead peers are instead detected at the transport layer: a new
websocket.tcp-user-timeout option (default 2min, Linux only) applies
TCP_USER_TIMEOUT to the listening socket, closing connections whose
peer stops acknowledging sent data.
- The "websocket connection aborted" warning and ws_clients_aborted
metric now fire only when the client actor task is actually aborted
or panics, not on every normal disconnect.
- Fix the kick log message to report the channel's configured capacity
instead of its remaining capacity (always 0 at that point).1 parent d9183f8 commit e4fc66d
5 files changed
Lines changed: 209 additions & 28 deletions
File tree
- crates
- client-api/src/routes
- core/src/client
- standalone
- src/subcommands
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
| 301 | + | |
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| |||
0 commit comments