Permalink
Browse files

Fixed bug non checking if NIO selector is valid

  • Loading branch information...
ctasada committed Mar 6, 2012
1 parent afaf7cf commit bb3ae95cb88f3976b8d4787e4454ebe6f149acb1
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 bb3ae95

Please sign in to comment.