Skip to content

Commit 9215363

Browse files
authored
Fix threading issue on listener notification (#28730)
This is a fix for #28729. 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.
1 parent ff2164c commit 9215363

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libs/elasticsearch-nio/src/main/java/org/elasticsearch/nio/SocketSelector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public void queueWrite(WriteOperation writeOperation) {
106106
if (isOpen() == false) {
107107
boolean wasRemoved = queuedWrites.remove(writeOperation);
108108
if (wasRemoved) {
109-
executeFailedListener(writeOperation.getListener(), new ClosedSelectorException());
109+
writeOperation.getListener().accept(null, new ClosedSelectorException());
110110
}
111111
} else {
112112
wakeup();

0 commit comments

Comments
 (0)