steveloughran commented on code in PR #3206:
URL: https://github.com/apache/parquet-java/pull/3206#discussion_r2070178775


##########
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/util/HadoopPositionOutputStream.java:
##########
@@ -61,8 +62,13 @@ public void flush() throws IOException {
 
   @Override
   public void close() throws IOException {
+    if (closed) {

Review Comment:
   safest to use an atomic bool here
   ```
   if (closed.getAndSet(true) { 
     return;
   }
   ```
   
   streams are nominally not thread safe, but cross stream use happens. Making 
close() itself thread safe is low cost and avoids problems on cleanup



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