We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Conn.closeErr
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
When I run my go program with race detector enabled, following logs were observed.
WARNING: DATA RACE local-setup-websocket-api-1 | Write at 0x00c0002e31b0 by goroutine 129: local-setup-websocket-api-1 | nhooyr.io/websocket.(*Conn).setCloseErrLocked() local-setup-websocket-api-1 | /go/pkg/mod/nhooyr.io/[email protected]/close.go:288 +0xd0 local-setup-websocket-api-1 | nhooyr.io/websocket.(*Conn).setCloseErr() local-setup-websocket-api-1 | /go/pkg/mod/nhooyr.io/[email protected]/close.go:282 +0x4c local-setup-websocket-api-1 | nhooyr.io/websocket.(*Conn).timeoutLoop() local-setup-websocket-api-1 | /go/pkg/mod/nhooyr.io/[email protected]/conn.go:190 +0x224 local-setup-websocket-api-1 | nhooyr.io/websocket.newConn.func2() local-setup-websocket-api-1 | /go/pkg/mod/nhooyr.io/[email protected]/conn.go:137 +0x80 local-setup-websocket-api-1 | local-setup-websocket-api-1 | Previous read at 0x00c0002e31b0 by goroutine 165: local-setup-websocket-api-1 | nhooyr.io/websocket.(*Conn).CloseNow() local-setup-websocket-api-1 | /go/pkg/mod/nhooyr.io/[email protected]/close.go:117 +0x138 ... ...
Apparently it's because when it's being set, it's protected by c.closeMu. https://github.com/nhooyr/websocket/blob/e3a2d32f704fb06c439e56d2a85334de04b50d32/close.go#L288
c.closeMu
However it's not when it's being read. https://github.com/nhooyr/websocket/blob/e3a2d32f704fb06c439e56d2a85334de04b50d32/close.go#L117
The text was updated successfully, but these errors were encountered:
I realise there is a PR #427 for it.
Sorry, something went wrong.
close.go: Rewrite how the library handles closing
231f9ae
Far simpler now. Sorry this took a while. Closes coder#427 Closes coder#429 Closes coder#434 Closes coder#436 Closes coder#437
Thanks for reporting. I've fixed this in #427. Please review and let me know if you see anything else.
db18a31
Sorry for the delay. Fixed by #427.
No branches or pull requests
When I run my go program with race detector enabled, following logs were observed.
Apparently it's because when it's being set, it's protected by
c.closeMu
.https://github.com/nhooyr/websocket/blob/e3a2d32f704fb06c439e56d2a85334de04b50d32/close.go#L288
However it's not when it's being read.
https://github.com/nhooyr/websocket/blob/e3a2d32f704fb06c439e56d2a85334de04b50d32/close.go#L117
The text was updated successfully, but these errors were encountered: