Fix threading issue on listener notification
This is a fix for Currently if a write operation is not properly
queued with a selector we notify the listener. However, we are doing
this by calling a method that is only meant for the selector thread to
call. This commit fixes that issue.
@@ -108,7 +108,7 @@ public class SocketSelector extends ESSelector {
if (isOpen() == false) {
boolean wasRemoved = queuedWrites.remove(writeOperation);
if (wasRemoved) {
- executeFailedListener(writeOperation.getListener(), new ClosedSelectorException());
+ writeOperation.getListener().onFailure(new ClosedSelectorException());
}
} else {
wakeup();
