You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Andrew McCready <aj...@yahoo.com> on 2002/08/13 22:41:12 UTC

[HttpClient] Unnecessarily beating up webservers?

Using the 20020811 tarball and jdk1.4.0, a get or post will retry as soon
as it finishes sending the request. I turned on logging and verified that
as soon as the last \r\n hits the wire, it starts on the next retry. For
example:

08-10 09:53:12 [main] httpclient.wire: >> [\r\n]
08-10 09:53:12 [main] httpclient.methods.PostMethod: enter PostMethod.writeRequestBody(HttpState, HttpConnection)
08-10 09:53:12 [main] commons.httpclient.HttpConnection: enter HttpConnection.write(byte[], int, int)
08-10 09:53:12 [main] commons.httpclient.HttpMethod: Attempt number 3 to write request
08-10 09:53:12 [main] commons.httpclient.HttpMethod: enter HttpMethodBase.writeRequest(HttpState, HttpConnection)
08-10 09:53:12 [main] commons.httpclient.HttpMethod: enter HttpMethodBase.writeRequestLine(HttpState, HttpConnection)
08-10 09:53:12 [main] commons.httpclient.HttpMethod: enter HttpMethodBase.generateRequestLine(HttpConnection, String, String, String, String)
08-10 09:53:12 [main] commons.httpclient.HttpConnection: enter HttpConnection.print(String)
08-10 09:53:12 [main] commons.httpclient.HttpConnection: enter HttpConnection.write(byte[])
08-10 09:53:12 [main] httpclient.wire: >> "POST /lookup.jsp HTTP/1.1" [\r\n]

The top line is the end of the second post and the last line is the start
of the third post.

To make sure the server really wasn't sending something back, I wrote a
quick server that would listen for a request and send a 404 as soon as it
read a post or get line (but would keep reading and dumping info). In the
httpclient log, it still shoots off 3 requests before it receives the
response and the server got all three requests. (client and server are
running on the same machine)

So why is httpclient sending three requests without waiting for a
response?




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [HttpClient] Unnecessarily beating up webservers?

Posted by Jeff Dever <js...@sympatico.ca>.
Hey Andrew,

>
> So why is httpclient sending three requests without waiting for a
> response?

Its a bug.  I made some changes to some fairly sensitive code recently, and introduced the problem.  Its a simple fix, I'm just doing some
testing with it now.

Tracking the problem with a bug report:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11677


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>