[OmniOS-discuss] Issue with java and poll

Peter Tribble peter.tribble at gmail.com
Tue Apr 18 11:28:15 UTC 2017


We're seeing a very occasional (sufficiently rare that it's
difficult to catch) problem with a java application (a web
application using Jetty under the hood) failing.

This started at the end of last year, and didn't correlate with any
changes we've made. And we've changed a few things since without
it going away.

The java stack at failure is

java.io.IOException: Bad file number
        at sun.nio.ch.DevPollArrayWrapper.poll0(Native Method)
        at sun.nio.ch.DevPollArrayWrapper.poll(DevPollArrayWrapper.java:223)
        at
sun.nio.ch.DevPollSelectorImpl.doSelect(DevPollSelectorImpl.java:98)
        ...

And after that it starts randomly dropping requests.

A few weeks of waiting and I managed to catch this with truss:

ioctl(146, DP_POLL, 0xFFFFBF7FD25FF2D0)         Err#9 EBADF

OK, so it really is the underlying ioctl that's failing. I've checked the
java source and looked at the native method and the code does
match up to the stack trace.

But has anyone got any ideas as to why we're failing?

According to ioctl(2), EBADF is returned if:

       EBADF
                 The fildes argument is not a valid open file descriptor.

At face value, this means the application has decided to close
/dev/poll, which seems a little odd.

The only other way we can get EBADF is out of the epoll stuff, I
believe, and we're running r151014 which I'm not sure has that.

First question: can we confirm that r151014 doesn't have epoll
and we can therefore rule out any oddities from that?

Second question: has anybody else come across this? According
to Google, it's a pretty rare thing, so that hasn't helped much.

Thanks,

-- 
-Peter Tribble
http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://omniosce.org/ml-archive/attachments/20170418/6601a1e3/attachment.html>


More information about the OmniOS-discuss mailing list