Permalink
Browse files

Fixed NIO Bug

Fixed java.nio.channels.CancelledKeyException
  • Loading branch information...
1 parent de2f94d commit 40ef19a72e706b45468b26c53cd927a4fe42d100 @ctasada ctasada committed Feb 19, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/java/voldemort/utils/SelectorManager.java
@@ -188,7 +188,8 @@ public void run() {
SelectionKey selectionKey = i.next();
i.remove();
- if(selectionKey.isReadable() || selectionKey.isWritable()) {
+ if(selectionKey.isValid()
+ && (selectionKey.isReadable() || selectionKey.isWritable())) {
Runnable worker = (Runnable) selectionKey.attachment();
worker.run();
}

0 comments on commit 40ef19a

Please sign in to comment.