You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by le...@apache.org on 2021/09/24 08:19:10 UTC

[dolphinscheduler] branch dev updated: [DS-6323][fix] EventExecuteService run loop without sleep which make cpu high (#6324)

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

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


The following commit(s) were added to refs/heads/dev by this push:
     new 89cc045  [DS-6323][fix] EventExecuteService run loop without sleep which make cpu high (#6324)
89cc045 is described below

commit 89cc045961477168ac8ff74c5d6604b606214775
Author: caishunfeng <ca...@users.noreply.github.com>
AuthorDate: Fri Sep 24 16:19:02 2021 +0800

    [DS-6323][fix] EventExecuteService run loop without sleep which make cpu high (#6324)
    
    Co-authored-by: caishunfeng <53...@qq.com>
---
 .../dolphinscheduler/server/master/runner/EventExecuteService.java    | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/EventExecuteService.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/EventExecuteService.java
index 5704175..3356842 100644
--- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/EventExecuteService.java
+++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/EventExecuteService.java
@@ -17,6 +17,7 @@
 
 package org.apache.dolphinscheduler.server.master.runner;
 
+import org.apache.dolphinscheduler.common.Constants;
 import org.apache.dolphinscheduler.common.enums.ExecutionStatus;
 import org.apache.dolphinscheduler.common.enums.StateEvent;
 import org.apache.dolphinscheduler.common.enums.StateEventType;
@@ -36,6 +37,7 @@ import org.apache.commons.lang.StringUtils;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutorService;
+import java.util.concurrent.TimeUnit;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -104,6 +106,8 @@ public class EventExecuteService extends Thread {
             try {
                 eventHandler();
 
+                TimeUnit.MILLISECONDS.sleep(Constants.SLEEP_TIME_MILLIS);
+
             } catch (Exception e) {
                 logger.error("Event service thread error", e);
             }