connection pool tries to reuse closed connections #14

Closed
hsenag opened this Issue Oct 6, 2011 · 3 comments

Projects

None yet

3 participants

@hsenag
Member
hsenag commented Oct 6, 2011

If a webserver doesn't implement keep-alive (e.g. httpd-shed as currently used in the test harness), HTTP doesn't notice and still tries to send a second request on the same connection.

@dcoutts
Member
dcoutts commented Sep 28, 2012

I'm getting a similar error, but instead of throwing ErrorReset or ErrorClosed, we just get the underlying socket error.

The client has sent a PUT request to the server. Here's the client log from the point where we get the response, and then try to send the next PUT request:

Debug: Received:
HTTP/1.1 204 No Content 
Connection: close
Content-Type: text/plain
Date: Fri, 28 Sep 2012 15:59:57 GMT
Server: Happstack/7.0.4

Debug: Sending:
PUT /user/foobar HTTP/1.1
Host: localhost:8080
User-Agent: hackage-import/0.2
Content-Length: 13
Content-Type: text/plain

Debug: Recovering connection to admin:admin@localhost:8080
hackage-import: <socket: 4>: resource vanished

The important thing to notice here is that the server is responding with Connection: close (and presumably then does actually close the socket).

@dcoutts
Member
dcoutts commented Sep 28, 2012

BTW, that's with HTTP-4000.2.5

@statusfailed

This issue also seems to be the cause of bug in cabal-install which crashes (for me) when using a proxy.

@statusfailed statusfailed referenced this issue in haskell/cabal Dec 6, 2013
Closed

cabal update fails with http_proxy #1602

@hsenag hsenag pushed a commit that closed this issue Feb 21, 2014
@ian-ross ian-ross Fix #14: connection pool tries to reuse closed connections
If a reply contains a "Connection: close" header, the connection is
closed and removed from the connection pool.  This fixes the problem
where HTTP tried to reuse connections that had been closed at the
server end, leading to "broken pipe" errors.
69d57a3
@hsenag hsenag closed this in 69d57a3 Feb 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment