We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The library seems to panic on occasion in:
func (w *WebsocketClient) disconnectAndRetry() { w.log.Warn("disconnected") w.heartbeat.Stop() w.conMutex.Lock() w.connected = false w.conMutex.Unlock() w.log.Info("retrying websocket connection in 30s") time.Sleep(30 * time.Second) w.Restart() }
at the line w.heartbeat.Stop(). Seems like w.heartbeat can be nil at times.
w.heartbeat.Stop()
w.heartbeat
nil
Patching so that it reads:
if w.heartbeat != nil { w.heartbeat.Stop() }
fixes the panic however w.heartbeat being nil at that time likely points to some other race condition.
The text was updated successfully, but these errors were encountered:
Hmm yes I will run the race detector on this.
Sorry, something went wrong.
Not sure it's related but when simulating a disconnection (as simple as by turning off the wifi), I'm getting a panic when I turn back on the wifi:
Edit: the patch above doesn't help
Edit2: socket.Conn is nil, then the seg fault happens. Adding this is enough:
socket.Conn
No branches or pull requests
The library seems to panic on occasion in:
at the line
w.heartbeat.Stop()
. Seems likew.heartbeat
can benil
at times.Patching so that it reads:
fixes the panic however
w.heartbeat
beingnil
at that time likely points to some other race condition.The text was updated successfully, but these errors were encountered: