Problems persist in KQueueSelectorProvider (Mac) in 7u6 ea

Jason Greene jgreene at redhat.com
Mon Aug 13 14:50:31 PDT 2012


On Aug 13, 2012, at 4:42 PM, Alan Bateman <Alan.Bateman at oracle.com> wrote:

> On 13/08/2012 20:13, Jason T. Greene wrote:
>> On 8/13/12 3:11 AM, Alan Bateman wrote:
>> -snip-
>>> I see Jason's reply on setInterest and there is indeed a problem there.
>>> The specification is that changing the interest set is effective at the
>>> next select operation but this Selector is doing it asynchronously. This
>>> needs to be changed to batch the changes to the next select as is done
>>> in the other Selector implementations. I will create a bug for that.
>> 
>> Ah that should have been obvious to me! Thanks for that.
>> 
>> I threw together a quick patch (attached below against 7u-dev), and it appears to resolve the issues on 6 and 7. Although it needs more testing.
>> 
>> The preClose problem disappears as well with this change. My hunch is that the tight spin loop on kqueue makes it impossible for close/dup2 to ever complete.
>> 
> Thanks for trying that out, it's good to hear that the problems have gone away. On the tight loop theory then can you check if a small sleep, or may a Thread.yield, causes the dup2 hang to go away too?

Sure I can give that a try. I'll try to get the dump you requested earlier if not.

> 
> On the patch, are you submitting it here as a contribution (once you are done with your testing)? I haven't looked at it closely yet but I think it is close to what we have in the epoll Selector.

Yes I just reused the same approach that epoll is using with slight alterations, since it seems to work well. The patch if useful is a contribution, although as you noticed its mostly a derivative. 


> 
> -Alan.
> 
> 


More information about the nio-dev mailing list