File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
server/src/main/java/org/elasticsearch/action/search Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -843,17 +843,24 @@ void onShardDone() {
843843 var channelListener = new ChannelActionListener <>(channel );
844844 RecyclerBytesStreamOutput out = dependencies .transportService .newNetworkBytesStream ();
845845 out .setTransportVersion (channel .getVersion ());
846+
847+ boolean success = false ;
846848 try (queryPhaseResultConsumer ) {
847849 Exception reductionFailure = queryPhaseResultConsumer .failure .get ();
848850 if (reductionFailure == null ) {
849851 writeSuccessfulResponse (out );
850852 } else {
851853 writeReductionFailureResponse (out , reductionFailure );
852854 }
855+ success = true ;
853856 } catch (IOException e ) {
854857 releaseAllResultsContexts ();
855858 channelListener .onFailure (e );
856859 return ;
860+ } finally {
861+ if (success == false ) {
862+ out .close ();
863+ }
857864 }
858865 ActionListener .respondAndRelease (channelListener , new BytesTransportResponse (out .moveToBytesReference ()));
859866 }
You can’t perform that action at this time.
0 commit comments