go-engine.io
go-engine.io copied to clipboard
bugfix for read/write locker conflict
#70 bugfix for read/write locker conflict
@ardingchen I recently merged a similar fix (albeit simpler) that might fix this issue. Could you give it a try? Thanks!
@erkie can you release this bug fix?
@hellofy like a tagged version release on this repo?
While this PR addresses a legit issue with using a lock for two conflicting purposes, potentially resulting in a panic (rather than a deadlock which was the issue recently resolved by a new write lock approach in the wrapper type), I believe it would be fundamentally better to use a different mutex for the websocket's read methods than is used to protect session.conn and session.transport. i.e. https://github.com/googollee/go-engine.io/pull/78/files#r326880910
However, given the locking going on in wrapper, the locking in the util.go types (reader and writer) is superfluous. Please consider the alternative solution in PR https://github.com/googollee/go-engine.io/pull/78.