Skip to content

Commit

Permalink
Save non empty response in else condition
Browse files Browse the repository at this point in the history
Signed-off-by: Aman Khare <[email protected]>
  • Loading branch information
Aman Khare committed Apr 8, 2024
1 parent c0ed643 commit d61477f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,9 @@ private void fillShardData(Map<ShardId, V> shardDataFromNode, Map<ShardId, Integ
if (isEmpty.apply(shardData.getValue())) {
this.emptyShardResponse[shardIdKey.get(shardId)] = true;
this.shardData[shardIdKey.get(shardId)] = null;
} else {
this.shardData[shardIdKey.get(shardId)] = shardData.getValue();
}
this.shardData[shardIdKey.get(shardId)] = shardData.getValue();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public interface Lister<NodesResponse extends BaseNodesResponse<NodeResponse>, N
protected final String type;
protected final Map<ShardId, ShardAttributes> shardAttributesMap;
private final Lister<BaseNodesResponse<T>, T> action;
protected AsyncShardFetchCache<T> cache;
protected final AsyncShardFetchCache<T> cache;
private final AtomicLong round = new AtomicLong();
private boolean closed;
final String reroutingKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d61477f

Please sign in to comment.