7023403: (ch) sun.nio.ch.SolarisEventPort.startPoll failed with AssertionError

Rémi Forax forax at univ-mlv.fr
Fri Mar 4 10:51:45 PST 2011


On 03/04/2011 07:03 PM, Alan Bateman wrote:
>
> This is another small fix to the asynchronous I/O implementation. One 
> the tests 
> (test/java/nio/channels/AsynchronousSocketChannel/Basic.java) has 
> failed a couple of times on solaris-x64. It's not easy to reproduce 
> but basically if a channel is asynchronously closed at just around the 
> time that it becomes writable and if the channel also has an 
> outstanding read then it will restart the read with an invalid file 
> descriptor.  Same thing if asynchronously closed at just around the 
> time that it becomes readable with an outstanding write operations. 
> The fix is small and ensues that it doesn't restart the read (or 
> write) then closed. The webrev with the changes is here;
>  http://cr.openjdk.java.net/~alanb/7023403/webrev/
>
> Thanks,
> -Alan.
>

In my opinion, it's more readable to do an instanceof 
AsynchronousCloseException.
Even if AsynchronousCloseException inherits from ClosedChannelException.

Also, it can be more efficient to do the instanceof check in 
lockAndUpdateEvents;

Rémi



More information about the nio-dev mailing list