Skip to content
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

HTTP server close connection with no response #4480

Closed
gopherbot opened this issue Dec 2, 2012 · 6 comments
Closed

HTTP server close connection with no response #4480

gopherbot opened this issue Dec 2, 2012 · 6 comments
Milestone

Comments

@gopherbot
Copy link
Contributor

by bart2yk:

The http server is closing the connection without any response

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
test files attached, run the files

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
macos and linux (last ubuntu)

Which version are you using?  (run 'go version')
tested on go1.0.2

Please provide any additional information below.
start servertest.go then run clienttest.go

servertest.go is a simple server 
clienttest.go will start a lot of parallel connections to stress the http server
 after a while you will receive an error like this:
Error on request:623 (Get http://localhost:8080/: dial tcp 127.0.0.1:8080: connection
reset by peer)

Attachments:

  1. servertest.go (259 bytes)
  2. clienttest.go (1457 bytes)
@gopherbot
Copy link
Contributor Author

Comment 1 by bart2yk:

tested with go1 version on ubuntu (last one) and i have a panic from the client:
net._Cfunc_CString(0x193d8047, 0x9, 0x0, 0x0)
    /tmp/go-build054638397/net/_obj/_cgo_defun.c:31 +0x2a
net.cgoLookupIPCNAME(0x193d8047, 0x9, 0x0, 0x0, 0x0, ...)
    /tmp/go-build054638397/net/_obj/_cgo_gotypes.go:175 +0xa0
net.cgoLookupIP(0x193d8047, 0x9, 0x0, 0x0, 0x0, ...)
    /tmp/go-build054638397/net/_obj/_cgo_gotypes.go:223 +0x3d
net.cgoLookupHost(0x193d8047, 0x9, 0x0, 0x0, 0x0, ...)
    /tmp/go-build054638397/net/_obj/_cgo_gotypes.go:101 +0x40
net.lookupHost(0x193d8047, 0x9, 0x0, 0x0, 0x0, ...)
    /usr/lib/go/src/pkg/net/lookup_unix.go:56 +0x3d
net.LookupHost(0x193d8047, 0x9, 0x0, 0x0, 0x0, ...)
    /usr/lib/go/src/pkg/net/doc.go:10 +0x3d
net.hostPortToIP(0x81a4648, 0x3, 0x193d8047, 0xe, 0x0, ...)
    /usr/lib/go/src/pkg/net/ipsock.go:120 +0x183
net.ResolveTCPAddr(0x81a4648, 0x3, 0x193d8047, 0xe, 0x0, ...)
    /usr/lib/go/src/pkg/net/tcpsock.go:31 +0x37
net.resolveNetAddr(0x81a6d04, 0x4, 0x81a4648, 0x3, 0x193d8047, ...)
    /usr/lib/go/src/pkg/net/dial.go:50 +0x35d
net.Dial(0x81a4648, 0x3, 0x193d8047, 0xe, 0x0, ...)
    /usr/lib/go/src/pkg/net/dial.go:92 +0x44
net/http.(*Transport).dial(0x193d9000, 0x81a4648, 0x3, 0x193d8047, 0xe, ...)
    /usr/lib/go/src/pkg/net/http/transport.go:299 +0xa6
net/http.(*Transport).getConn(0x193d9000, 0x193d80c0, 0x193d80c0, 0x0)
    /usr/lib/go/src/pkg/net/http/transport.go:311 +0xa7
net/http.(*Transport).RoundTrip(0x193d9000, 0x193da000, 0x193d80a0, 0x0, 0x0, ...)
    /usr/lib/go/src/pkg/net/http/transport.go:155 +0x23b
net/http.send(0x193da000, 0x18836d80, 0x193d9000, 0x0, 0x0, ...)
    /usr/lib/go/src/pkg/net/http/client.go:133 +0x325
net/http.(*Client).doFollowingRedirects(0x193d8020, 0x193da000, 0x0, 0x0, 0x0, ...)
    /usr/lib/go/src/pkg/net/http/client.go:227 +0x568
net/http.(*Client).Get(0x193d8020, 0x193d8040, 0x16, 0x81a4b74, 0x0, ...)
    /usr/lib/go/src/pkg/net/http/client.go:176 +0x86
main.doRequest(0x193d8020, 0x115, 0x193d9000)
    /home/cornel/Dropbox/work/go/tests/clienttest.go:28 +0x69
main.requestRoutine()
    /home/cornel/Dropbox/work/go/tests/clienttest.go:62 +0x115
created by main.main
    /home/cornel/Dropbox/work/go/tests/clienttest.go:74 +0x5d

@gopherbot
Copy link
Contributor Author

Comment 2 by bart2yk:

tested with go version devel +1f3ebf9a7548 Mon Dec 03 14:04:18 2012 +0100
and the client and the server are having the same problem as described

@bradfitz
Copy link
Contributor

bradfitz commented Dec 3, 2012

Comment 3:

I think you're either running out of file descriptors or your CustomDial's 300 second
deadline is happening.  (maybe you thought that meant 5 minutes of inactivity... it
doesn't.  It means fail in 5 minutes)
The DNS lookup problem is probably issue #3575.
I see nothing to fix here.

Status changed to Invalid.

@gopherbot
Copy link
Contributor Author

Comment 4 by bart2yk:

The panic is from client, this problem is from go 1.0.3, in 1.0.2 this is not
reproducing.
The bug is not about the client, it's about the server. You can reproduce this without
using the clienttest, you can use ab (ab -n 100000 -c 2000 http://localhost:8080/) and
servertest.go to reproduce the Connection reset by peer.
If you need other info or explanations let me know.

@gopherbot
Copy link
Contributor Author

Comment 5 by cdamian-akela@kds.com:

please be sure that you have enough file descriptors

@gopherbot
Copy link
Contributor Author

Comment 6 by bart2yk:

please be sure that you have enough file descriptors

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants