You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Christopher Schultz <ch...@christopherschultz.net> on 2020/11/03 15:15:27 UTC

Re: [OT] Weirdest Tomcat Behavior Ever?

Mark,

On 11/3/20 03:05, Mark Thomas wrote:
> On 02/11/2020 12:16, Eric Robinson wrote:
> 
> <snip/>
> 
>> Gotcha, thanks for the clarification. Let's see what happens when the users start hitting it at 8:00 am Eastern.
> 
> Progress. The first attempt to write to the socket triggers the
> following exception:
> 
> 02-Nov-2020 14:33:54.083 FINE [http-bio-3016-exec-13]
> org.apache.tomcat.util.net.JIoEndpoint$DebugOutputStream.write [301361476]
>   java.net.SocketException: Bad file descriptor (Write failed)
>      at java.net.SocketOutputStream.socketWrite0(Native Method)
>      at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)
>      at java.net.SocketOutputStream.write(SocketOutputStream.java:155)
>      at
> org.apache.tomcat.util.net.JIoEndpoint$DebugOutputStream.write(JIoEndpoint.java:1409)
>      at
> org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:247)
>      at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:480)
>      at
> org.apache.coyote.http11.InternalOutputBuffer.endRequest(InternalOutputBuffer.java:183)
>      at
> org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:761)
>      at org.apache.coyote.Response.action(Response.java:174)
>      at org.apache.coyote.Response.finish(Response.java:274)
>      at
> org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:322)
>      at
> org.apache.catalina.connector.Response.finishResponse(Response.java:537)
>      at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:480)
>      at
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1083)
>      at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:640)
>      at
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:321)
>      at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>      at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>      at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
>      at java.lang.Thread.run(Thread.java:748)
> 
> Because this is an instance of an IOException, Tomcat assumes it has
> been caused by the client dropping the connection and silently swallows
> it. I'll be changing that later today so the exception is logged as
> DEBUG level for all new Tomcat versions.
> 
> Possible causes of "java.net.SocketException: Bad file descriptor" I've
> been able to find are:
> 
> 1. OS running out of file descriptors.
> 
> 2. Trying to use a closed socket.

Wouldn't it be great if the Java library had more than a dozen or so 
IOException subclasses? It's really frustrating to try to figure out 
WHAT KIND of error occurred when all you get is IOException with a 
(possibly localized) error message. :(

-chris

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