mqtt icon indicating copy to clipboard operation
mqtt copied to clipboard

Race detect!!!

Open prospero78 opened this issue 6 years ago • 2 comments

WARNING: DATA RACE Read at 0x00c0000601f0 by goroutine 39: runtime.chansend() d:/coding/golang/src/runtime/chan.go:142 +0x0

  d:/coding/golang/_home/src/github.com/jeffallen/mqtt/mqtt.go:885 +0x23d

Previous write at 0x00c0000601f0 by goroutine 43: runtime.closechan() d:/coding/golang/src/runtime/chan.go:334 +0x0 github.com/jeffallen/mqtt.(*ClientConn).reader.func1() d:/coding/golang/_home/src/github.com/jeffallen/mqtt/mqtt.go:743 +0x5b github.com/jeffallen/mqtt.(*ClientConn).reader() d:/coding/golang/_home/src/github.com/jeffallen/mqtt/mqtt.go:754 +0x630

prospero78 avatar Oct 15 '19 13:10 prospero78

I gave this a quick look, and I'm not in a position to solve this soon. If you have a suggested fix for it, send a PR and I'll take a look at it.

jeffallen avatar Oct 16 '19 10:10 jeffallen

The easiest solution is to introduce mutexes. Unfortunately, I do not have time to make my code correct. The authorities do not want to hear anything, but there is definitely a problem.

prospero78 avatar Oct 16 '19 13:10 prospero78