On Sun, 2007-10-14 at 16:37 +0200, Roland Weber wrote: > Asankha C. Perera wrote: > > When I am doing a load test using Jakarta-HttpComponents-Bench/1.1, I am > > seeing the following stack trace if the load test returns HTTP 500 > > responses. This cannot be seen a load test with HTTP 200 responses. Why > > is a connection closed when using keepalives when responding to an HTTP > > 500 is this something HTTP forces? > > I can't tell how your stack trace relates to that question. > HTTP 1.1 does not require connections to be closed after a > server error response. In fact, it says in section 8.1.2: > > ... the client > SHOULD assume that the server will maintain a persistent connection, > even after error responses from the server. > > However, that's not a MUST. Clients are allowed to close > connections after an error response. > The default strategy in HttpCore does not check the response status. > It checks for a "Connection:" header. Does your server happen to > send "Connection: close" in case of a status 500? > > cheers, > Roland >
Asankha, Roland The 'connection: close' header is added by the ResponseConnControl protocol interceptor [1]. In many cases 500 status code represents a fatal error, which may leave the connection in an inconsistent state. Therefore, I think it is a reasonable defensive measure to drop the connection. Do you want this changed? Oleg [1] https://svn.apache.org/repos/asf/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/ResponseConnControl.java > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
