You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by do...@apache.org on 2026/04/20 19:03:30 UTC

(seatunnel) branch dev updated: [Fix][Zeta] prevent cancel stuck and downgrade tmp cleanup failure (#10729)

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

dybyte pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/seatunnel.git


The following commit(s) were added to refs/heads/dev by this push:
     new 2c81f7f3c3 [Fix][Zeta] prevent cancel stuck and downgrade tmp cleanup failure (#10729)
2c81f7f3c3 is described below

commit 2c81f7f3c3174f6825ed6f27361db18aa5064d6a
Author: corgy-w <73...@users.noreply.github.com>
AuthorDate: Tue Apr 21 03:03:24 2026 +0800

    [Fix][Zeta] prevent cancel stuck and downgrade tmp cleanup failure (#10729)
---
 .../file/sink/commit/FileSinkAggregatedCommitter.java   | 12 ++++++++++--
 .../engine/server/dag/physical/PhysicalVertex.java      | 17 ++++++++++++-----
 2 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sink/commit/FileSinkAggregatedCommitter.java b/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sink/commit/FileSinkAggregatedCommitter.java
index 934374cab9..0c2614a2fe 100644
--- a/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sink/commit/FileSinkAggregatedCommitter.java
+++ b/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sink/commit/FileSinkAggregatedCommitter.java
@@ -59,8 +59,16 @@ public class FileSinkAggregatedCommitter
                                 hadoopFileSystemProxy.renameFile(
                                         mvFileEntry.getKey(), mvFileEntry.getValue(), true);
                             }
-                            // second delete transaction directory
-                            hadoopFileSystemProxy.deleteFile(entry.getKey());
+                            // Data files are already committed after rename; tmp cleanup is
+                            // best-effort and should not fail the whole checkpoint.
+                            try {
+                                hadoopFileSystemProxy.deleteFile(entry.getKey());
+                            } catch (Exception cleanupException) {
+                                log.warn(
+                                        "delete transaction directory [{}] failed after successful commit, ignore this cleanup error.",
+                                        entry.getKey(),
+                                        cleanupException);
+                            }
                         }
                     } catch (Throwable e) {
                         log.error(
diff --git a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/dag/physical/PhysicalVertex.java b/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/dag/physical/PhysicalVertex.java
index ac30be68ea..a4cc0d8585 100644
--- a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/dag/physical/PhysicalVertex.java
+++ b/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/dag/physical/PhysicalVertex.java
@@ -412,12 +412,10 @@ public class PhysicalVertex {
         int i = 0;
         // In order not to generate uncontrolled tasks, We will try again until the taskFuture is
         // completed
-        Address executionAddress;
+        Address executionAddress = getCurrentExecutionAddress();
         while (!taskFuture.isDone()
-                && nodeEngine
-                                .getClusterService()
-                                .getMember(executionAddress = getCurrentExecutionAddress())
-                        != null) {
+                && executionAddress != null
+                && nodeEngine.getClusterService().getMember(executionAddress) != null) {
             try {
                 i++;
                 log.info(
@@ -444,6 +442,15 @@ public class PhysicalVertex {
                     throw new RuntimeException(ex);
                 }
             }
+            executionAddress = getCurrentExecutionAddress();
+        }
+
+        if (!taskFuture.isDone() && ExecutionState.CANCELING.equals(getExecutionState())) {
+            log.warn(
+                    "{} cancel did not receive a terminal callback before member {} became unavailable, mark task as CANCELED locally.",
+                    taskFullName,
+                    executionAddress);
+            updateTaskState(ExecutionState.CANCELED);
         }
     }