Skip to content

Commit 8e3b175

Browse files
committed
Use AbstractRunnable and force execution
1 parent 01e230f commit 8e3b175

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

server/src/main/java/org/elasticsearch/cluster/coordination/PeerFinder.java

+14-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.elasticsearch.common.settings.Settings;
3232
import org.elasticsearch.common.transport.TransportAddress;
3333
import org.elasticsearch.common.unit.TimeValue;
34+
import org.elasticsearch.common.util.concurrent.AbstractRunnable;
3435
import org.elasticsearch.discovery.ConfiguredHostsResolver;
3536
import org.elasticsearch.threadpool.ThreadPool.Names;
3637
import org.elasticsearch.transport.TransportException;
@@ -201,9 +202,20 @@ private void handleWakeUp() {
201202
}
202203
});
203204

204-
futureExecutor.schedule(new Runnable() {
205+
futureExecutor.schedule(new AbstractRunnable() {
205206
@Override
206-
public void run() {
207+
public boolean isForceExecution() {
208+
return true;
209+
}
210+
211+
@Override
212+
public void onFailure(Exception e) {
213+
assert false : e;
214+
logger.debug("unexpected exception in PeerFinder wakeup", e);
215+
}
216+
217+
@Override
218+
protected void doRun() {
207219
synchronized (mutex) {
208220
handleWakeUp();
209221
}

0 commit comments

Comments
 (0)