Aias00 opened a new issue, #6568:
URL: https://github.com/apache/shenyu/issues/6568

   ## Description
   `private static synchronized void sendMessageBySession(...)` is a static 
synchronized method — one monitor guards ALL websocket sends across all 
namespaces and sessions. The send uses 
`session.getBasicRemote().sendText(message)` (synchronous/blocking). `send` 
iterates `NAMESPACE_SESSION_MAP.forEach(session -> sendMessageBySession(...))`, 
so a fan-out to G gateways is fully serialized on one thread; a slow gateway 
stalls every other gateway's notification.
   
   ## Location
   ```
   shenyu-admin/.../listener/websocket/WebsocketCollector.java:291 (method), 
255,285 (callers iterate sessions)
   ```
   
   ## Impact
   At scale (many gateway nodes), config propagation latency = sum of 
per-gateway send time, serialized. A single slow/hung gateway connection blocks 
all config pushes to all gateways.
   
   ## Suggested fix
   Drop the `synchronized`; switch to 
`session.getAsyncRemote().sendText(message)` (non-blocking); use per-session 
send queues.
   
   ## Related existing issue(s)
   None
   
   _Identified during the 2026-08-02 audit; full list in 
[`docs/issue-candidates-2026-08-02.md`](docs/issue-candidates-2026-08-02.md)._


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to