You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Bernd Bartke <be...@bbartke.de> on 2003/12/26 11:03:52 UTC

Rejecting connections: empty http header if maxProcessors reached

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 :-)

Hi,

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.

Bye.

Re: Rejecting connections: empty http header if maxProcessors reached

Posted by Remy Maucherat <re...@apache.org>.
Bernd Bartke wrote:
> 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 :-)
> 
> Hi,
> 
> what is the desired behaviour if tomcat 4.1.29 rejects incoming requests 
> because of maxProcessors reached?
> Should tomcat return an empty http header?

Tomcat will just reject the TCP connection (actually, it's the OS TCP 
stack which will).

Rémy


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org