On 03/11/2020 15:05, Eric Robinson wrote: >> From: Eric Robinson <eric.robin...@psmnv.com> >>> From: Mark Thomas <ma...@apache.org>
<snip/> >>> 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) <snip/> >>> 1. OS running out of file descriptors. >>> >>> 2.Trying to use a closed socket. >>> >>> I want to review the source code to see if there are any others. There is an option 3 - a JVM bug. There were bugs in this area back in the 1.2/1.3/1.4 days. It seems unlikely that such a bug resurfaced now - especially given that the issue happens with NIO as well as BIO. >>> I don't think we are seeing 2 as there is no indication of the Socket, >>> InputStream or OutputStream being closed in the logs. >>> >>> That leaves 1. Possible causes here are a file descriptor leak or >>> normal operations occasionally needing more than the current limit. I >>> don't think it is a leak as I'd expect to see many more errors of this >>> type after the first and we aren't seeing that. That leaves the >>> possibility of the current limit being a little too low. >>> >>> My recommendation at this point is to increase the limit for file >>> descriptors. >>> Meanwhile, I'll look at the JRE source to see if there are any other >>> possible triggers for this exception. <snip/> > Wait, never mind. I realized the per-process limits are what matters. I > checked, and nofile was set to 4096 for the relevant java process. > > I did... > > # prlimit --pid 8730 --nofile=16384:16384 > > That should give java some extra breathing room if the issue is max open > files, right? I'm not the person to ask that question. Linux administration is not an area I'd consider myself sufficiently knowledgeable to give a definitive answer. It looks OK based on some quick searching. How have things been with the higher limit? More issues, fewer issues, about the same? Or maybe even no issues (he asks hopefully)? Mark --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org