diff --git a/server/src/main/java/org/opensearch/gateway/AsyncShardBatchFetch.java b/server/src/main/java/org/opensearch/gateway/AsyncShardBatchFetch.java index 41cf0da434c4c..8a292e0925686 100644 --- a/server/src/main/java/org/opensearch/gateway/AsyncShardBatchFetch.java +++ b/server/src/main/java/org/opensearch/gateway/AsyncShardBatchFetch.java @@ -228,8 +228,9 @@ private void fillShardData(Map shardDataFromNode, Map, N protected final String type; protected final Map shardAttributesMap; private final Lister, T> action; - protected AsyncShardFetchCache cache; + protected final AsyncShardFetchCache cache; private final AtomicLong round = new AtomicLong(); private boolean closed; final String reroutingKey; diff --git a/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayStartedShardsBatch.java b/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayStartedShardsBatch.java index 9886e8472422c..89362988b4d85 100644 --- a/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayStartedShardsBatch.java +++ b/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayStartedShardsBatch.java @@ -156,7 +156,7 @@ protected NodeGatewayStartedShardsBatch nodeOperation(NodeRequest request) { ); } catch (Exception e) { // should return null in case of known exceptions being returned from getShardInfoOnLocalNode method. - if (e instanceof IllegalStateException || e.getMessage().contains(INDEX_NOT_FOUND)) { + if (e instanceof IllegalStateException || e.getMessage().contains(INDEX_NOT_FOUND) || e instanceof IOException) { shardsOnNode.put(shardId, null); } else { // return actual exception as it is for unknown exceptions