Closed jjiang-stripe closed 2 years ago
Hey @jjiang-stripe! Thanks for taking the time to report this. It does make sense to enable race-detection in tests and fix any failures. I will pick this up unless you want to - or someone else.
i have tested the fix against the code sample https://github.com/jjiang-stripe/proxyproto-race/blob/master/main.go
Fixed by #87! Thanks a lot for reporting @jjiang-stripe and bow to you @mschneider82 for another sweet contribution!
v0.6.2
is tagged.
Hello!
I have a test that runs with the
-race
flag that started to fail with v0.6.1. I've created a minimal repro here: https://github.com/jjiang-stripe/proxyproto-race/blob/master/main.goThat example is just running a super basic SSH server and client and it looks like Go's SSH server's running into a race when trying to update deadlines in its
readLoop
andkexLoop
goroutines:I believe this was introduced in https://github.com/pires/go-proxyproto/pull/76 because there's a local variable being set in
SetDeadline()
.Unfortunately I'm not familiar enough with what's going on here to tell if this is actually an issue or propose a fix beyond maybe throwing a lock in there. I'd appreciate a fix here (or if this isn't actually a concern, an explanation would be nice).
Happy to provide more details, but given that I'm in very unfamiliar territory, I'm not sure how much help I can be 😅