This is an automated email from the ASF dual-hosted git repository.

lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git


The following commit(s) were added to refs/heads/master by this push:
     new f3f700885 [core] Fix the race condition in OrphanFilesClean (#3165)
f3f700885 is described below

commit f3f700885cd04109cc32988e2880cef7e8e1c2fb
Author: Aitozi <[email protected]>
AuthorDate: Mon Apr 8 10:25:56 2024 +0800

    [core] Fix the race condition in OrphanFilesClean (#3165)
---
 .../src/main/java/org/apache/paimon/operation/OrphanFilesClean.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/paimon-core/src/main/java/org/apache/paimon/operation/OrphanFilesClean.java 
b/paimon-core/src/main/java/org/apache/paimon/operation/OrphanFilesClean.java
index b68cf8cc7..f6ffd102c 100644
--- 
a/paimon-core/src/main/java/org/apache/paimon/operation/OrphanFilesClean.java
+++ 
b/paimon-core/src/main/java/org/apache/paimon/operation/OrphanFilesClean.java
@@ -476,8 +476,10 @@ public class OrphanFilesClean {
                     .forEach(
                             p -> {
                                 deleteFileOrDirQuietly(p);
-                                deleteFiles.add(p);
-                                deletedFilesNum++;
+                                synchronized (this) {
+                                    deleteFiles.add(p);
+                                    deletedFilesNum++;
+                                }
                             });
         }
 

Reply via email to