Skip to content

Commit bf217d5

Browse files
committed
fix test
1 parent 203a8d9 commit bf217d5

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/DataNodeRequestSender.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.elasticsearch.index.Index;
2525
import org.elasticsearch.index.query.QueryBuilder;
2626
import org.elasticsearch.index.shard.ShardId;
27-
import org.elasticsearch.index.shard.ShardNotFoundException;
2827
import org.elasticsearch.search.internal.AliasFilter;
2928
import org.elasticsearch.tasks.CancellableTask;
3029
import org.elasticsearch.tasks.Task;
@@ -109,13 +108,13 @@ private void trySendingRequestsForPendingShards(TargetShards targetShards, Compu
109108
}
110109
for (ShardId shardId : pendingShardIds) {
111110
if (targetShards.getShard(shardId).remainingNodes.isEmpty()) {
112-
shardFailures.compute(shardId, (k, v) -> {
113-
if (v == null) {
114-
return new ShardFailure(true, new ShardNotFoundException(shardId, "no shard copies found {}"));
115-
} else {
116-
return new ShardFailure(true, v.failure);
117-
}
118-
});
111+
shardFailures.compute(
112+
shardId,
113+
(k, v) -> new ShardFailure(
114+
true,
115+
v == null ? new NoShardAvailableActionException(shardId, "no shard copies found") : v.failure
116+
)
117+
);
119118
}
120119
}
121120
if (shardFailures.values().stream().anyMatch(shardFailure -> shardFailure.fatal)) {

0 commit comments

Comments
 (0)