Skip to content

Commit 181c286

Browse files
committed
Make sure to return in case of IOException, add comments
1 parent 2ef1d2c commit 181c286

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

server/src/main/java/org/elasticsearch/action/search/SearchQueryThenFetchAsyncAction.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,13 +879,15 @@ void onShardDone() {
879879
} catch (IOException e) {
880880
releaseAllResultsContexts();
881881
channelListener.onFailure(e);
882+
return;
882883
}
883884
ActionListener.respondAndRelease(
884885
channelListener,
885886
new BytesTransportResponse(out.moveToBytesReference(), out.getTransportVersion())
886887
);
887888
}
888889

890+
// Writes the "successful" response (see NodeQueryResponse for the corresponding read logic)
889891
private void writeSuccessfulResponse(RecyclerBytesStreamOutput out) throws IOException {
890892
final QueryPhaseResultConsumer.MergeResult mergeResult;
891893
try {
@@ -924,6 +926,7 @@ private void writeSuccessfulResponse(RecyclerBytesStreamOutput out) throws IOExc
924926
NodeQueryResponse.writeMergeResult(out, mergeResult, queryPhaseResultConsumer.topDocsStats);
925927
}
926928

929+
// Writes the "reduction failure" response (see NodeQueryResponse for the corresponding read logic)
927930
private void writeReductionFailureResponse(RecyclerBytesStreamOutput out, Exception reductionFailure) throws IOException {
928931
final int resultCount = queryPhaseResultConsumer.getNumShards();
929932
out.writeVInt(resultCount);

0 commit comments

Comments
 (0)