-
Notifications
You must be signed in to change notification settings - Fork 18k
net: tcpproxy test hangs under Go tip (due to splice), works on Go 1.10 #25985
New issue
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
Comments
This Close blocking is suspicious:
|
Not sure the root cause yet. See golang/go#25985.
Investigating. |
Note that we just worked around it with inetaf/tcpproxy@7f81f77 so if you try to reproduce, use the commit just before that. |
I can reproduce it. It hangs in exactly the same way on my machine. |
It seems like moving this defer to the top of HandleConn fixes the hang in the test, but it is still unclear why the hang was happening in the first place. Perhaps this is a clue. Still investigating. EDIT: the following test, adapted from the https://github.com/google/tcpproxy code, seems to reproduce the issue reliably from within package net.
This test seems to reinforce the aforementioned observation about changing the order of the deferred Close calls. Furthermore, it exhibits very similar behavior to the original reported issue, including the blocking Close. EDIT 2: I believe I've figured it out. I think it has to do with the way poll.Splice holds locks. Still not 100% sure the solution is the correct one, but I'll send a CL shortly. Sorry for the trouble. |
Change https://golang.org/cl/120317 mentions this issue: |
https://github.com/google/tcpproxy at git rev dbc151467 has test hangs at Go tip (rev f3f7bd5) but works fine with Go 1.10.
Sometimes it even passes at Go tip, but with
-count=20
I've never seen it pass more than a couple times before hanging:But with Go tip:
If I send it SIGQUIT:
If I disable the splice support (f2316c2) in Go 1.11 (with just an added
return
statement at the top ofsplice_linux.go
'sfunc splice
), then it works again./cc @acln0 @danderson
The text was updated successfully, but these errors were encountered: