Summary
In event-gateway/gateway-runtime/internal/connectors/receiver/websocket/broker_api_connector.go, the channel receives in inboundLoop (around line 406) and outboundLoop (around line 465) use the plain form (msg := <-conn.inbound / msg := <-conn.outbound). When teardown closes these channels, the receive returns a zero/nil value and subsequent dereferences (e.g., msg.Value) can panic.
Proposed Fix
Apply the comma-ok pattern to both receive sites so the loops exit cleanly when the channel is closed:
// inboundLoop
case msg, ok := <-conn.inbound:
if !ok || msg == nil {
return
}
// outboundLoop
case msg, ok := <-conn.outbound:
if !ok || msg == nil {
return
}
References
Raised by @senthuran16.
Summary
In
event-gateway/gateway-runtime/internal/connectors/receiver/websocket/broker_api_connector.go, the channel receives ininboundLoop(around line 406) andoutboundLoop(around line 465) use the plain form (msg := <-conn.inbound/msg := <-conn.outbound). When teardown closes these channels, the receive returns a zero/nil value and subsequent dereferences (e.g.,msg.Value) can panic.Proposed Fix
Apply the comma-ok pattern to both receive sites so the loops exit cleanly when the channel is closed:
References
Raised by @senthuran16.