User Request
Type: bug
Target: Console Application
Submitted by: @aashu2006
Console Request ID: d1a18a87-352d-4daf-9bd0-df9adf221443
Description
What happened:
In pkg/api/handlers/websocket.go:192-204, DisconnectUser closes connections directly:
client.conn.WriteMessage(...)
client.conn.Close() // closes conn directly
The HandleConnection reader loop subsequently gets an error and sends to h.unregister. Meanwhile the writer goroutine may attempt conn.WriteMessage after Close(). The connection is closed twice and the client's send channel may be closed twice, causing a panic.
What I expected:
DisconnectUser should send through the h.unregister channel to let the hub handle cleanup in a coordinated way, preventing double-close races.
Steps to reproduce:
- Trigger
DisconnectUser while the WebSocket writer goroutine is active
- Observe a panic from double-close on the connection or send channel
This issue was automatically created from the KubeStellar Console.
User Request
Type: bug
Target: Console Application
Submitted by: @aashu2006
Console Request ID: d1a18a87-352d-4daf-9bd0-df9adf221443
Description
What happened:
In
pkg/api/handlers/websocket.go:192-204,DisconnectUsercloses connections directly:The
HandleConnectionreader loop subsequently gets an error and sends toh.unregister. Meanwhile the writer goroutine may attemptconn.WriteMessageafterClose(). The connection is closed twice and the client's send channel may be closed twice, causing a panic.What I expected:
DisconnectUsershould send through theh.unregisterchannel to let the hub handle cleanup in a coordinated way, preventing double-close races.Steps to reproduce:
DisconnectUserwhile the WebSocket writer goroutine is activeThis issue was automatically created from the KubeStellar Console.