Problems persist in KQueueSelectorProvider (Mac) in 7u6 ea (original) (raw)
Jason T. Greene jason.greene at redhat.com
Sat Aug 11 22:27:38 PDT 2012
- Previous message: Problems persist in KQueueSelectorProvider (Mac) in 7u6 ea
- Next message: Problems persist in KQueueSelectorProvider (Mac) in 7u6 ea
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I spoke too soon. This change does not work on all combinations of VM and OSX version.
On 8/11/12 11:50 PM, Jason T. Greene wrote:
I have been pretty short on time with paternity leave, but I was able to debug this a little bit further. One of the main issues is that interest ops is zero on keys that kqueue is returning, hence the tight loop.
There appears to be thread safety issues with EVADD/EVDELETE from multiple threads. Synchronizing KQueueArrayWrapper.setInterest(int,int) seems to resolve both issues, at least so far. I do wonder if an alternative approach using EVENABLE/EVDISABLE might eliminate the need for extra locking.
On 8/10/12 6:36 PM, David M. Lloyd wrote: We're consistently seeing issues under load on Mac with KQueueSelectorProvider.
There are two possibly related symptoms: the KQueueSelectorImpl is going into a mode where select() does not block, despite the continued emptiness of the selected key set; and FileDispatcherImpl#preClose0 is hanging, presumably in dup2(), trying to close a socket. My current hypothesis that some evil race condition exists and is being tripped between kqueue and dup2 (a relatively rare way to close a socket, at least until NIO came along I guess). My thought though is that sockets should not be preclosed this way: instead it would be better to use shutdown(fd, SHUTRDWR), which would effectively preclose the socket and hopefully dodge this issue. I'm hopefully going to have time to try out a patch which does this, but I'm taking a couple weeks off starting tonight so I may not have time, so we shall see.
-- Jason T. Greene JBoss AS Lead / EAP Platform Architect JBoss, a division of Red Hat
- Previous message: Problems persist in KQueueSelectorProvider (Mac) in 7u6 ea
- Next message: Problems persist in KQueueSelectorProvider (Mac) in 7u6 ea
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]