select() returns empty key set
Alan Bateman
Alan.Bateman at Sun.COM
Thu Mar 5 08:19:48 PST 2009
Robert Larsen wrote:
> :
> It would seem like there is a socket that is unregistered with the
> selector but is not successfully unregistered with the kernel. Am I right ?
>
It's a complicated timing issue that arises when a SocketChannel is
closed at just around the time that it gets registered with the polling
facility. Closing is a two-step process, the first step involves dup the
file descriptor to a special pre-close file descriptor that is connected
to one end of a socket pair. To cut a long story short the socket pair
ends up getting registered with the polling facility. When originally
reported it took several weeks under heavy load to duplicate. The
changes to fix it will be more extensive that originally expected so
this is why the fix is not in jdk6. It is best to assume it will need to
bake in jdk7 for a while before thinking about other releases.
-Alan.
More information about the nio-dev
mailing list