Skip to content

Commit e4fc66d

Browse files
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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ similar = "2.3"
298298
slab = "0.4.7"
299299
sled = "0.34.7"
300300
smallvec = { version = "1.11", features = ["union", "const_generics"] }
301-
socket2 = "0.5"
301+
socket2 = { version = "0.5", features = ["all"] }
302302
sourcemap = "9.3.1"
303303
sqllogictest = "0.17"
304304
sqllogictest-engines = "0.17"

0 commit comments

Comments
 (0)