You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
migrated from Bugzilla #464559
status RESOLVED severity normal in component MQTT-Go for 1.1
Reported in version 0.9 on platform PC
Assigned to: Al Stockdill-Mander
On 2015-04-14 00:22:00 -0400, shirou WAKAYAMA wrote:
paho library causes panic when invoke Disconnect().
c := MQTT.NewClient(opts)
if token := c.Connect(); token.Wait() && token.Error() != nil {
panic(token.Error())
}
fmt.Println("plz down mosquitto now")
time.Sleep(5 * time.Second)
c.Disconnect(200)
time.Sleep(5 * time.Second)
}
How to reproduce:
mosquitto up
go run close_panic.go
mosquitto down after "plz down mosquitto now" shows
wait 5 sec
panic
This is caused by close(c.stop) in the Client.disconnect(). c.stop is already closed at the internalConnLost(), so the second disconnect() close already closed channel.
To avoid panic, I think check the channel is already close or not using select/case.
migrated from Bugzilla #464559
status RESOLVED severity normal in component MQTT-Go for 1.1
Reported in version 0.9 on platform PC
Assigned to: Al Stockdill-Mander
On 2015-04-14 00:22:00 -0400, shirou WAKAYAMA wrote:
On 2015-04-14 00:42:15 -0400, shirou WAKAYAMA wrote:
On 2015-04-17 11:19:32 -0400, Al Stockdill-Mander wrote:
The text was updated successfully, but these errors were encountered: