go-engine.io icon indicating copy to clipboard operation
go-engine.io copied to clipboard

bugfix for read/write locker conflict

Open ardingchen opened this issue 6 years ago • 4 comments
trafficstars

#70 bugfix for read/write locker conflict

ardingchen avatar May 06 '19 09:05 ardingchen

@ardingchen I recently merged a similar fix (albeit simpler) that might fix this issue. Could you give it a try? Thanks!

erkie avatar Aug 10 '19 14:08 erkie

@erkie can you release this bug fix?

HelloFy avatar Aug 14 '19 12:08 HelloFy

@hellofy like a tagged version release on this repo?

erkie avatar Aug 14 '19 14:08 erkie

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.

chappjc avatar Sep 22 '19 02:09 chappjc