On Fri, 19 Apr 2024 15:41:54 GMT, robert engels <d...@openjdk.org> wrote:

> I think this is a trivial fix. We should be able to either:
> 
> 1. Flush the FixedLengthOutputStream when the bytes remaining is 0.

This is reasonable, and should fix `B8293562`, but it won't fix `B4769350`, 
which creates a chunked response, and then leaks it. See the `proxyReply` 
method in that file.

> 2. Always flush the output stream after an exchange completes. This won't 
> affect performance if it has already been flushed()/closed() previously.

The exchange does not automatically complete when you exit the `handle` method; 
you need to explicitly complete it, either by calling close or by closing the 
output stream. Either of these actions will flush the output stream.

This behavior enables users to asynchronously handle the exchange outside of 
the `handle` method. I don't know if anyone actually uses that functionality, 
but it's been here forever, and I don't think we want to change it now.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/18667#issuecomment-2066890570

Reply via email to