Skip to content
New issue

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

Data race in mqtt client #170

Closed
antlad opened this issue Dec 25, 2017 · 4 comments
Closed

Data race in mqtt client #170

antlad opened this issue Dec 25, 2017 · 4 comments

Comments

@antlad
Copy link

antlad commented Dec 25, 2017

WARNING: DATA RACE
Write by goroutine 82:
XXX/vendor/github.com/eclipse/paho%2emqtt%2egolang.(*client).Connect.func1()
XXX/vendor/github.com/eclipse/paho.mqtt.golang/client.go:240 +0x1603

Previous read by goroutine 60:
XXX/vendor/github.com/eclipse/paho%2emqtt%2egolang.errorWatch()
XXX/vendor/github.com/eclipse/paho.mqtt.golang/net.go:324 +0x4b

Goroutine 82 (running) created at:
XXX/vendor/github.com/eclipse/paho%2emqtt%2egolang.(*client).Connect()
XXX/vendor/github.com/eclipse/paho.mqtt.golang/client.go:277 +0x41e
.....

Goroutine 60 (finished) created at:
XXX/vendor/github.com/eclipse/paho%2emqtt%2egolang.(*client).Connect.func1()
XXX/vendor/github.com/eclipse/paho.mqtt.golang/client.go:267 +0x1bb0

@danielbprice
Copy link
Contributor

I can confirm that I have seen this, or something close, involving errorWatch() too.

@alsm
Copy link
Contributor

alsm commented Jan 5, 2018

I wonder if that's because errorWatch() was run as a goroutine but not part of the workers syncGroup (and I don't know why it wasn't). I've just made a change to catch it returning as part of the waitgroup, hopefully this will remove this issue.

@danielbprice
Copy link
Contributor

I have run a bunch of testing of this change (commit cd4337d) and I have not seen the race recur. I think that this can be resolved.

@alsm
Copy link
Contributor

alsm commented Jan 12, 2018

thanks 👍

@alsm alsm closed this as completed Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants