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 <[email protected]>
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 <[email protected]>
---
 .../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);
             }

Reply via email to