Get the following error when broadcasting via threads: "The remote endpoint was in state [TEXT_FULL_WRITING] which is an invalid state for called method." Imagine that multiple threads end up broadcasting to WS at same time, and the WS isn't done with a prior request.
Have mitigated by surrounding the broadcast code in an exclusive lock. However, occasionally, I get an "a timeout occurred after 30 seconds trying to acquire a exclusive lock with name" error.
You can reproduce the issue by something like the following, where Application.WebSocketsConnectionManager should exist as using the normal WebsocketRegister("/ws/{channel}", new BroadcastListener())
Get the following error when broadcasting via threads: "The remote endpoint was in state [TEXT_FULL_WRITING] which is an invalid state for called method." Imagine that multiple threads end up broadcasting to WS at same time, and the WS isn't done with a prior request.
Have mitigated by surrounding the broadcast code in an exclusive lock. However, occasionally, I get an "a timeout occurred after 30 seconds trying to acquire a exclusive lock with name" error.
See https://dev.lucee.org/t/websocket-issues-hanging-server/2386 for exact error mesage and trace.
You can reproduce the issue by something like the following, where Application.WebSocketsConnectionManager should exist as using the normal
WebsocketRegister("/ws/{channel}", new BroadcastListener())