The problem arises because the number of expected responses is zero,
so the server has not sent a request yet.
So the http.readLoop() receives a packet on a channel, where it tries
to read, but in my case, the ServeHTTP in reverseproxy.go and
RoundTrip()/roundTrip in transport.go, hasn't sent the request yet.
It feels like it appears when a client disconnects, and the connection
to the reversproxy is closed, but the connection from the reverseproxy
to backend is still up. But that's just a thought.
/Josef
If I would hammer the rproxy with connections from the same IP, and at
the same time run "watch -n 0 'ss | grep https'", I see that
connections to the backend is left behind, and new ones are created.
So it seems that pconn.Close(), which in affect is called when the
number of idlepconns has been reached, is not terminating the backend
connection.
If I would take it easy, the keep-alive is working properly.
--- a/src/pkg/net/http/transport.go Sat Nov 19 15:17:40 2011 +0900
+++ b/src/pkg/net/http/transport.go Sat Nov 19 23:46:36 2011 +0100
@@ -507,6 +507,9 @@
if err == io.EOF {
return true
}
+ if e,ok := err.(*net.OpError); ok && e.Op == "read" {
+ return true
+ }
if remoteSideClosedFunc != nil {
return remoteSideClosedFunc(err)
I think this was solved in an other way in some weekly before
December. So the latest should not show this behavior.