Hi Jesse,

> -----Original Message-----
> From: Jesse Barnum [mailto:jsb_tom...@360works.com]
> Sent: Monday, December 23, 2013 5:46 PM
> To: Tomcat Users List
> Subject: Re: EOFException in AjpNioProcessor
> 
> On Dec 22, 2013, at 8:54 AM, Konstantin Preißer <kpreis...@apache.org>
> wrote:
> 
> > I suspect the AJP client intentionally closes the connection if e.g. the 
> > HTTP
> client which connected to the outer Webserver (HTTPD, IIS) aborted the
> HTTP connection (or there was some other error) so this error is reflected at
> Tomcat (which can therefore throw this exception). Otherwise Tomcat or the
> Webappp would not know that there was an error and if it e.g. was sending a
> 10 GB file, it would continue to send it.
> 
> If this is the case, then shouldn't the AJP client include the AbortException 
> as
> the 'causedBy' property for the EOFException? The last line in the stack trace
> is:
> 
> > at
> org.apache.coyote.ajp.AjpNioProcessor.readSocket(AjpNioProcessor.java:35
> 8)
> 
> So something went wrong when it tried to read the socket, but I would think
> there would be some java.net.* or java.io.* exception (ie. AbortException,
> SocketException) corresponding to that problem. Throwing the
> EOFException without an associated cause sounds like there is something
> wrong with the state of the data being received, not with the underlying
> network socket itself.

An AbortException or SocketException would mean that there was a problem with 
the socket so that the connection closed abnormally (which could also happen if 
there are still bytes to send when the connection is closed by the client, and 
the linger timeout occurs). However, in the case of the EOFException, the 
problem is not the socket itself, but that the AJP client which is connected to 
the socket (HTTPD with mod_jk, IIS with ISAPI Redirector etc.) has unexpectedly 
closed the connection. This could be thought as of a protocol error.

I have not much knowledge about how mod_jk, ISAPI redirectors or other AJP 
clients work, but if they intentionally close the connection, then I think this 
is because the AJP protocol does not have a message indicating that the HTTP 
connection to the client has failed, so it has to close the AJP connection to 
let Tomcat know there was an error on the HTTP connection side (I also could be 
wrong here, I'm just guessing).

I agree that an "EOFException" can be a bit misleading in this case, but since 
it is a subclass of IOException, you should be fine if you already catch 
IOExceptions.


Regards,
Konstantin Preißer





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to