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

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


The following commit(s) were added to refs/heads/master by this push:
     new bb40d4af0 [INLONG-6852][Audit] agent and dataproxy report audit data 
when the program exits (#6855)
bb40d4af0 is described below

commit bb40d4af02dfdb698f9c25248b116b1fbff339a3
Author: doleyzi <[email protected]>
AuthorDate: Tue Dec 13 11:28:33 2022 +0800

    [INLONG-6852][Audit] agent and dataproxy report audit data when the program 
exits (#6855)
    
    Co-authored-by: doleyzi <[email protected]>
    Co-authored-by: Charles Zhang <[email protected]>
---
 .../src/main/java/org/apache/inlong/agent/core/AgentMain.java          | 2 +-
 inlong-dataproxy/bin/dataproxy-stop.sh                                 | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/AgentMain.java
 
b/inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/AgentMain.java
index 6816f57f3..1377386de 100644
--- 
a/inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/AgentMain.java
+++ 
b/inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/AgentMain.java
@@ -94,6 +94,7 @@ public class AgentMain {
             try {
                 LOGGER.info("stopping agent gracefully");
                 agentManager.stop();
+                AuditUtils.send();
             } catch (Exception ex) {
                 LOGGER.error("stop agent manager error: ", ex);
             }
@@ -120,7 +121,6 @@ public class AgentMain {
             LOGGER.error("agent running exception: ", ex);
         } finally {
             manager.stop();
-            AuditUtils.send();
         }
     }
 }
diff --git a/inlong-dataproxy/bin/dataproxy-stop.sh 
b/inlong-dataproxy/bin/dataproxy-stop.sh
index c31d39444..7b4e64ecf 100644
--- a/inlong-dataproxy/bin/dataproxy-stop.sh
+++ b/inlong-dataproxy/bin/dataproxy-stop.sh
@@ -20,4 +20,7 @@
 #
 
 # this program kills the dataProxy
+ps -ef |grep "org.apache.inlong.dataproxy.node.Application"|grep 
"inlong-dataproxy"|grep -v grep|awk '{print $2}'|xargs kill
+echo "Stopping DataProxy application, please wait for 15s. "
+sleep 15
 ps -ef |grep "org.apache.inlong.dataproxy.node.Application"|grep 
"inlong-dataproxy"|grep -v grep|awk '{print $2}'|xargs kill -9

Reply via email to