diff --git a/src/main/java/org/elasticsearch/action/support/single/shard/TransportShardSingleOperationAction.java b/src/main/java/org/elasticsearch/action/support/single/shard/TransportShardSingleOperationAction.java index 7fe7e15e5d0..19511703e84 100644 --- a/src/main/java/org/elasticsearch/action/support/single/shard/TransportShardSingleOperationAction.java +++ b/src/main/java/org/elasticsearch/action/support/single/shard/TransportShardSingleOperationAction.java @@ -41,6 +41,8 @@ import org.elasticsearch.transport.*; import java.io.IOException; +import static org.elasticsearch.action.support.TransportActions.isShardNotAvailableException; + /** * A base class for single shard read operations. */ @@ -139,7 +141,7 @@ public abstract class TransportShardSingleOperationAction { // this might happen if the state of the river index has not been propagated yet to this node, which // should happen pretty fast since we managed to get the _meta in the RiversRouter Throwable failure = ExceptionsHelper.unwrapCause(e); - if ((failure instanceof NoShardAvailableActionException) || (failure instanceof ClusterBlockException) || (failure instanceof IndexMissingException)) { + if (isShardNotAvailableException(failure)) { logger.debug("failed to get _meta from [{}]/[{}], retrying...", e, routing.riverName().type(), routing.riverName().name()); final ActionListener listener = this; threadPool.schedule(TimeValue.timeValueSeconds(5), ThreadPool.Names.SAME, new Runnable() { diff --git a/src/main/java/org/elasticsearch/river/routing/RiversRouter.java b/src/main/java/org/elasticsearch/river/routing/RiversRouter.java index 9c7be825826..776ddba205c 100644 --- a/src/main/java/org/elasticsearch/river/routing/RiversRouter.java +++ b/src/main/java/org/elasticsearch/river/routing/RiversRouter.java @@ -36,6 +36,7 @@ import org.elasticsearch.common.component.AbstractLifecycleComponent; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.support.XContentMapValues; +import org.elasticsearch.index.shard.IllegalIndexShardStateException; import org.elasticsearch.indices.IndexMissingException; import org.elasticsearch.river.RiverIndexName; import org.elasticsearch.river.RiverName; @@ -122,6 +123,8 @@ public class RiversRouter extends AbstractLifecycleComponent imple // ignore, we will get it next time } catch (IndexMissingException e) { // ignore, we will get it next time + } catch (IllegalIndexShardStateException e) { + // ignore, we will get it next time } catch (Exception e) { logger.warn("failed to get/parse _meta for [{}]", e, mappingType); }