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
net/http: Server panic if listener returns connection with RemoteAddr() == nil #23022
Comments
What situation? If you're implementing your own If a concrete implementation in the standard library is returning nil, how? |
By very specific situation I mean that we didn't find stable way to reproduce this situation. Our listener wraps "keep alive" logic:
|
c.File() dups the fd. Maybe that messes it up. |
I don't know why the dup would cause the network address to be missing, but I also don't know why you are doing it at all. It's not obvious to me that this is a net/http problem. Can you give us a small standalone test case that shows you getting a |
Unfortunately, I don't have test to reproduce this behavior, it happens rarely on running server.
where |
I have the same issue, it seems it will be trigger by some request, which I encountered a couple of times but cannot reproduce the bug by myself. |
Our listener wrapper, in order to implement graceful restart feature.
|
@azavorotnii - Are you still experiencing this issue ? Have you had a chance to try with 1.11beta3 and see if it resolves the issue ? |
|
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
Just FYI: Hit the same problem with go 1.10.3. Very rare to happen, but it showed up in a machine exposed to the Internet. conn.RemoteAddr() returned nil. Don't have data to see what triggered it. |
What version of Go are you using (
go version
)?1.9.2
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?Any.
What did you do?
In very specific situation listener returns net.Conn object with "RemoteAddr" that is "nil".
What did you expect to see?
Server returns error from server.Serve() or ignore issue.
What did you see instead?
Panic:
Related code lines:
Field "c.remoteAddr" is used only in couple places, so should not be harmful to do instead:
The text was updated successfully, but these errors were encountered: