<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div><div>We're seeing a very occasional (sufficiently rare that it's<br></div>difficult to catch) problem with a java application (a web<br></div>application using Jetty under the hood) failing.<br><br></div><div>This started at the end of last year, and didn't correlate with any<br>changes we've made. And we've changed a few things since without<br>it going away.<br></div><div><br></div>The java stack at failure is<br><br>java.io.IOException: Bad file number<br>        at sun.nio.ch.DevPollArrayWrapper.poll0(Native Method)<br>        at sun.nio.ch.DevPollArrayWrapper.poll(DevPollArrayWrapper.java:223)<br>        at sun.nio.ch.DevPollSelectorImpl.doSelect(DevPollSelectorImpl.java:98)<br>        ...<br><br></div>And after that it starts randomly dropping requests.<br><br></div>A few weeks of waiting and I managed to catch this with truss:<br><br>ioctl(146, DP_POLL, 0xFFFFBF7FD25FF2D0)         Err#9 EBADF<br><br></div>OK, so it really is the underlying ioctl that's failing. I've checked the<br>java source and looked at the native method and the code does<br>match up to the stack trace.<br><br>But has anyone got any ideas as to why we're failing?<br></div><br></div>According to ioctl(2), EBADF is returned if:<br><br>       EBADF<br>                 The fildes argument is not a valid open file descriptor.<br><br></div><div>At face value, this means the application has decided to close<br></div><div>/dev/poll, which seems a little odd.<br><br></div>The only other way we can get EBADF is out of the epoll stuff, I<br></div>believe, and we're running r151014 which I'm not sure has that.<br></div><br>First question: can we confirm that r151014 doesn't have epoll<br></div>and we can therefore rule out any oddities from that?<br><br></div>Second question: has anybody else come across this? According<br></div>to Google, it's a pretty rare thing, so that hasn't helped much.<br clear="all"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><br></div><div>Thanks,<br><br></div><div>-- <br><div class="gmail_signature">-Peter Tribble<br><a target="_blank" href="http://www.petertribble.co.uk/">http://www.petertribble.co.uk/</a> - <a target="_blank" href="http://ptribble.blogspot.com/">http://ptribble.blogspot.com/</a></div>
</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>