Seems like OutputStream in StreamingResponseBodyReturnValueHandler#StreamingResponseBodyTask is never closed. In the call() method of StreamingResponseBodyTask, shouldn't we call this.outputStream.close() after streamingBody wrote to the outputStream and outputStream is flushed?
i.e. Should the code be something like the below instead:
@Override
public Void call() throws Exception {
this.streamingBody.writeTo(this.outputStream);
this.outputStream.flush();
this.outputStream.close();
return null;
}
Comment From: simonbasle
This outputstream
is obtained from the ServletReponse
and ultimately the container's jakarta.servlet.http.HttpServletResponse#getOutputStream()
(a ServletOutputStream
).
Generally speaking the container can be held responsible of closing that particular OutputStream
, so this shouldn't be an issue.
If you have investigated an actual problem and determined with confidence that this is the root cause, please provide additional details and we'll reopen this issue.
If you have any further questions, please follow up on Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.
(marking as for: stackoverflow
&status: invalid
as a result)