Unexpected exception in the selector loop

"Trustin Lee (이희승)" trustin at gmail.com
Mon Dec 28 06:57:47 EST 2009


Hi Shay,

I suspect a bug in the JDK you are running because the exception is
being raised by the Selector implementation.  Netty might be able to
work around this issue though.  Please let me know if you found what
exactly is causing the problem so that we can see what we can do on our
side.

HTH,
Trustin

Shay Banon wrote:
> I think I know what might have caused this by analyzing what I changed
> recently, though I have not fully gone through the netty code to
> understand why this might happen.
> 
> It seems like this might happen (not all the time) when I close a
> channel from within a channel future listener registered when closing
> another channel :). Seems like when I don't do that, I don't get the
> sporadic cancelled key exception.
> 
> I will try and do more tests and see if this is really the case. 
> 
> Shay
> 
> On Sun, Dec 27, 2009 at 12:38 PM, Shay Banon <kimchy at gmail.com
> <mailto:kimchy at gmail.com>> wrote:
> 
>     Hi,
> 
>       I started to get the following exception, any hint what to do with it?
> 
>     [netty.channel.socket.nio.NioWorker] Unexpected exception in the
>     selector loop.
>     java.nio.channels.CancelledKeyException
>     at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionKeyImpl.java:55)
>     at sun.nio.ch.SelectionKeyImpl.readyOps(SelectionKeyImpl.java:69)
>     at
>     sun.nio.ch.KQueueSelectorImpl.updateSelectedKeys(KQueueSelectorImpl.java:105)
>     at sun.nio.ch.KQueueSelectorImpl.doSelect(KQueueSelectorImpl.java:74)
>     at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69)
>     at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)
>     at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:158)
>     at
>     org.jboss.netty.util.internal.IoWorkerRunnable.run(IoWorkerRunnable.java:46)
>     at
>     java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>     at
>     java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>     at java.lang.Thread.run(Thread.java:637)
> 
>     Cheers,
>     Shay
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/netty-users/attachments/20091228/73e49186/attachment.bin 


More information about the netty-users mailing list