You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2021/09/27 02:05:23 UTC

[GitHub] [iotdb] THUMarkLau opened a new pull request #4037: [to rel/0.12] Avoid double close in level compaction execution

THUMarkLau opened a new pull request #4037:
URL: https://github.com/apache/iotdb/pull/4037


   ## Description
   ![image](https://user-images.githubusercontent.com/37140360/134835045-5ec0e81d-292f-47ff-85d7-7d688544fdbb.png)
   Sometimes in level compaction, the output stream of target file could be closed twice, which will lead to IOException.


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] qiaojialin merged pull request #4037: [To rel/0.12] [IOTDB-1741] Avoid double close in level compaction execution

Posted by GitBox <gi...@apache.org>.
qiaojialin merged pull request #4037:
URL: https://github.com/apache/iotdb/pull/4037


   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] wangchao316 commented on a change in pull request #4037: [To rel/0.12] [IOTDB-1741] Avoid double close in level compaction execution

Posted by GitBox <gi...@apache.org>.
wangchao316 commented on a change in pull request #4037:
URL: https://github.com/apache/iotdb/pull/4037#discussion_r716484926



##########
File path: server/src/main/java/org/apache/iotdb/db/engine/compaction/utils/CompactionUtils.java
##########
@@ -431,7 +431,10 @@ public static void merge(
       writer.endFile();
       targetResource.close();
     } finally {
-      writer.close();
+      if (writer.canWrite()) {
+        // avoid double close

Review comment:
       I feel we should set "canWrite" to volatile.
   Because if two threads close concurrency, this will be not find.
   This mistake is inevitable.
   do you think ? @qiaojialin 




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org