red5-server icon indicating copy to clipboard operation
red5-server copied to clipboard

Websocket reliability changes

Open kdkd opened this issue 1 month ago • 0 comments

Commit from kdkd fork 5adfcf8

Websocket reliability changes

In WsWriteTimeout, ConcurrentSkipListSet ordering collapses endpoints that share the same timeoutExpiry (comparator returns 0 on equal timestamps). Any concurrent async writes that pick the same millisecond expiry will drop all but one endpoint from the timeout set, so those writes never time out and can hang indefinitely.

Origin checking in server/DefaultServerEndpointConfigurator.java no longer throws when the Origin header is missing; with cross-origin policy enabled it rejects missing origins cleanly and logs the reason.

The connection ID stored in WebSocketConnection is a random string, but the on-close fallback lookup uses the container session ID. When the session user properties can’t be read (the scenario the fallback is meant for), the lookup always fails and the connection stays registered in the scope/manager, leaking resources and skipping disconnect notifications.


kdkd avatar Nov 29 '25 00:11 kdkd