mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-09 06:25:07 +00:00
Added catch EsRejectedExecutionException when trying to reschedule river start
This commit is contained in:
parent
5b1820b723
commit
38d895bf1a
@ -39,6 +39,7 @@ import org.elasticsearch.common.inject.Injectors;
|
|||||||
import org.elasticsearch.common.inject.ModulesBuilder;
|
import org.elasticsearch.common.inject.ModulesBuilder;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
|
import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||||
import org.elasticsearch.indices.IndexMissingException;
|
import org.elasticsearch.indices.IndexMissingException;
|
||||||
@ -282,12 +283,16 @@ public class RiversService extends AbstractLifecycleComponent<RiversService> {
|
|||||||
if (isShardNotAvailableException(failure)) {
|
if (isShardNotAvailableException(failure)) {
|
||||||
logger.debug("failed to get _meta from [{}]/[{}], retrying...", e, routing.riverName().type(), routing.riverName().name());
|
logger.debug("failed to get _meta from [{}]/[{}], retrying...", e, routing.riverName().type(), routing.riverName().name());
|
||||||
final ActionListener<GetResponse> listener = this;
|
final ActionListener<GetResponse> listener = this;
|
||||||
threadPool.schedule(TimeValue.timeValueSeconds(5), ThreadPool.Names.SAME, new Runnable() {
|
try {
|
||||||
@Override
|
threadPool.schedule(TimeValue.timeValueSeconds(5), ThreadPool.Names.SAME, new Runnable() {
|
||||||
public void run() {
|
@Override
|
||||||
client.prepareGet(riverIndexName, routing.riverName().name(), "_meta").setListenerThreaded(true).execute(listener);
|
public void run() {
|
||||||
}
|
client.prepareGet(riverIndexName, routing.riverName().name(), "_meta").setListenerThreaded(true).execute(listener);
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
} catch (EsRejectedExecutionException ex) {
|
||||||
|
logger.debug("Couldn't schedule river start retry, node might be shutting down", ex);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.warn("failed to get _meta from [{}]/[{}]", e, routing.riverName().type(), routing.riverName().name());
|
logger.warn("failed to get _meta from [{}]/[{}]", e, routing.riverName().type(), routing.riverName().name());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user