select() returns empty key set

Robert Larsen robert at komogvind.dk
Tue Mar 10 01:40:26 PDT 2009


Alan Bateman wrote:
> 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.
Thanks for the explanation. Using the Poll based selector seems to have
solved the problem, so thanks a lot.

I have 130 game servers that had this problem, each handled between 0
and 250 simultanious connections. But I also have a couple of
chatservers based on the same framework, each handling between 1500 and
10000 connections, but they always "behave". Does that make sense ?


Robert

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20090310/291adbb8/attachment.bin 


More information about the nio-dev mailing list