ffang commented on code in PR #3555:
URL: https://github.com/apache/cxf/pull/3555#discussion_r4219464278


##########
rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingOutputStream.java:
##########
@@ -89,9 +89,7 @@ public void writeCacheTo(StringBuilder out, String 
charsetName, long limit) thro
     @Override
     public void write(byte[] b) throws IOException {
         if (closed.get()) {
-            // already closed and logged: pass through only, do not cache again
-            getFlowThroughStream().write(b);
-            return;
+            throw new IOException("The channel has been closed already");

Review Comment:
   Hi @reta,
   
   +1, agreed. Throwing is cleaner than passing through: Tomcat 11 and Jetty 12 
already fail that late write, so this just makes Tomcat 10.1 behave the same, 
and nothing gets cached so the temp-file leak stays fixed. I ran the logging 
module build on this branch locally: all tests pass.
   
    One small thing: the Javadoc I added in #3553 (above the write() overrides) 
still says late writes are "only passed through to the flow-through stream". 
Could you update it to say they are rejected with an IOException? 
   
   Thanks!
   Freeman



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to