adelapena commented on code in PR #2420:
URL: https://github.com/apache/cassandra/pull/2420#discussion_r1243581101


##########
src/java/org/apache/cassandra/io/sstable/SSTableZeroCopyWriter.java:
##########
@@ -195,14 +197,15 @@ public void close()
             writer.close();
     }
 
-    public void writeComponent(Component.Type type, DataInputPlus in, long 
size) throws ClosedChannelException
+    public void writeComponent(Component component, DataInputPlus in, long 
size) throws ClosedChannelException
     {
-        logger.info("Writing component {} to {} length {}", type, 
componentWriters.get(type).getPath(), prettyPrintMemory(size));
+        SequentialWriter writer = componentWriters.get(component.name);

Review Comment:
   I get this error locally when running `eclipse-warnings` with JDK 8:
   ```
   eclipse-warnings:
       [mkdir] Created dir: /Users/adelapena/src/cassandra/trunk/build/ecj
        [echo] Running Eclipse Code Analysis.  Output logged to 
/Users/adelapena/src/cassandra/trunk/build/ecj/eclipse_compiler_checks.txt
        [java] ----------
        [java] 1. ERROR in 
/Users/adelapena/src/cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableZeroCopyWriter.java
 (at line 202)
        [java]  SequentialWriter writer = componentWriters.get(component.name);
        [java]                   ^^^^^^
        [java] Potential resource leak: 'writer' may not be closed
        [java] ----------
        [java] 1 problem (1 error)
   
   BUILD FAILED
   ```
   CircleCI also hits it for j8: 
https://app.circleci.com/pipelines/github/adelapena/cassandra/2986/workflows/82e3ccc4-83ce-49c8-ab0d-036d100cae8e/jobs/54244
   
   However, it doesn't fail for j11 builds: 
https://app.circleci.com/pipelines/github/adelapena/cassandra/2986/workflows/554d79db-c157-4e53-944a-ced1dffc242f
   
   Do you have a link to the CircleCI run? Maybe it was a j11-only run? j8 
support will we dropped very soon 
([CASSANDRA-18255](https://issues.apache.org/jira/browse/CASSANDRA-18255)), but 
we still need it.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to