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

gaojun2048 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 3ccc6a8bd1 [Hotfix][Zeta] Fix task cannot be stopped when system is 
busy (#7280)
3ccc6a8bd1 is described below

commit 3ccc6a8bd1e381a23e21eebcd9fca0d87694ba7c
Author: hailin0 <[email protected]>
AuthorDate: Mon Jul 29 10:41:09 2024 +0800

    [Hotfix][Zeta] Fix task cannot be stopped when system is busy (#7280)
---
 .../org/apache/seatunnel/engine/server/TaskExecutionService.java  | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/TaskExecutionService.java
 
b/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/TaskExecutionService.java
index 19878545ed..94f0fa324f 100644
--- 
a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/TaskExecutionService.java
+++ 
b/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/TaskExecutionService.java
@@ -626,7 +626,7 @@ public class TaskExecutionService implements 
DynamicMetricsProvider {
         if (localMap.size() > 0) {
             try {
                 if (!metricsImap.tryLock(
-                        Constant.IMAP_RUNNING_JOB_METRICS_KEY, 2, 
TimeUnit.SECONDS)) {
+                        Constant.IMAP_RUNNING_JOB_METRICS_KEY, 5, 
TimeUnit.SECONDS)) {
                     logger.warning("try lock failed in update metrics");
                     return;
                 }
@@ -640,7 +640,11 @@ public class TaskExecutionService implements 
DynamicMetricsProvider {
                         "The Imap acquisition failed due to the hazelcast node 
being offline or restarted, and will be retried next time",
                         e);
             } finally {
-                metricsImap.unlock(Constant.IMAP_RUNNING_JOB_METRICS_KEY);
+                try {
+                    metricsImap.unlock(Constant.IMAP_RUNNING_JOB_METRICS_KEY);
+                } catch (Throwable e) {
+                    logger.warning("unlock imap failed in update metrics", e);
+                }
             }
         }
         this.printTaskExecutionRuntimeInfo();

Reply via email to