tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernd Bartke <>
Subject Rejecting connections: empty http header if maxProcessors reached
Date Fri, 26 Dec 2003 10:03:52 GMT
I sent posted this message into the tomcat-user list two days ago, but 
got no respond so far - so maybe it's a question to the developers :-)


what is the desired behaviour if tomcat 4.1.29 rejects incoming requests 
because of maxProcessors reached?
Should tomcat return an empty http header?

To simulate the expected load on tomcat 4.1.29 I wrote a java client 
which starts conurrent threads accessing the web resource:

HttpURLConnection connection;
URL request;
InputStream input;
connection = (HttpURLConnection)request.openConnection();
input = connection.getInputStream();

When getting the input-stream out of the connection an IOException is 
thrown if maxProcessors is reached.
That seams ok for me, but how can a client determine if a "real" 
exception occured or the server rejected a connection?
I tried to look into the http-header of the connection:
Map headerFields;
connection = (HttpURLConnection)request.openConnection();
headerFields = connection.getHeaderFields();

But the header does not contain any fields ... an empty Map is returned.
Is it really the desired behavior of a server to return an empty header 
or shouldn't it better return at least an response code indication the 
rejected request?

I think a client should at least be able to call:
int responseCode = connection.getResponseCode();
to evaluate the response code - but if the header contains no fields, an 
IOException is thrown also.


View raw message