User Request
Type: bug
Target: Console Application
Submitted by: @aashu2006
Console Request ID: 5a266a3f-83cb-4c6b-beb2-30b118a45dc0
Description
What happened:
In pkg/api/handlers/websocket.go:244-246, DisconnectUser calls client.conn.WriteMessage directly while the writer goroutine at line 454 also writes to the same connection. gorilla/websocket explicitly states connections support only one concurrent writer. This race can cause a panic or corrupt WebSocket frames.
What I expected:
DisconnectUser should send a sentinel value through client.send channel so the writer goroutine sends the close frame itself, maintaining single-writer semantics.
Steps to reproduce:
- Run with
-race flag
- Log out a user with an active WebSocket connection while messages are being sent
- Observe race detector flag on concurrent conn.WriteMessage calls
This issue was automatically created from the KubeStellar Console.
User Request
Type: bug
Target: Console Application
Submitted by: @aashu2006
Console Request ID: 5a266a3f-83cb-4c6b-beb2-30b118a45dc0
Description
What happened:
In
pkg/api/handlers/websocket.go:244-246,DisconnectUsercallsclient.conn.WriteMessagedirectly while the writer goroutine at line 454 also writes to the same connection. gorilla/websocket explicitly states connections support only one concurrent writer. This race can cause a panic or corrupt WebSocket frames.What I expected:
DisconnectUsershould send a sentinel value throughclient.sendchannel so the writer goroutine sends the close frame itself, maintaining single-writer semantics.Steps to reproduce:
-raceflagThis issue was automatically created from the KubeStellar Console.