Skip to content

Commit b552c0d

Browse files
committed
merge fatal
1 parent 5565434 commit b552c0d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,15 @@ private void trackShardLevelFailure(ShardId shardId, boolean fatal, Exception or
194194
// Retain only one meaningful exception and avoid suppressing previous failures to minimize memory usage, especially when handling
195195
// many shards.
196196
shardFailures.compute(shardId, (k, current) -> {
197+
boolean mergedFatal = fatal || ExceptionsHelper.unwrap(e, TaskCancelledException.class) != null;
197198
if (current == null) {
198-
return new ShardFailure(fatal, e);
199+
return new ShardFailure(mergedFatal, e);
199200
}
201+
mergedFatal |= current.fatal;
200202
if (e instanceof NoShardAvailableActionException || ExceptionsHelper.unwrap(e, TaskCancelledException.class) != null) {
201-
return new ShardFailure(current.fatal || fatal, current.failure);
203+
return new ShardFailure(mergedFatal, current.failure);
202204
}
203-
return new ShardFailure(current.fatal || fatal, e);
205+
return new ShardFailure(mergedFatal, e);
204206
});
205207
}
206208

0 commit comments

Comments
 (0)