diff --git a/agent/src/main/java/io/wdd/agent/executor/CommandExecutor.java b/agent/src/main/java/io/wdd/agent/executor/CommandExecutor.java index 63f485e..87139bd 100644 --- a/agent/src/main/java/io/wdd/agent/executor/CommandExecutor.java +++ b/agent/src/main/java/io/wdd/agent/executor/CommandExecutor.java @@ -1,6 +1,7 @@ package io.wdd.agent.executor; import com.google.common.io.ByteStreams; +import io.wdd.agent.config.utils.AgentCommonThreadPool; import io.wdd.agent.executor.redis.StreamSender; import io.wdd.agent.executor.thread.LogToArrayListCache; import io.wdd.common.beans.executor.ExecutionMessage; @@ -40,9 +41,13 @@ public class CommandExecutor { * @param executionMessage get from EXECUTOR_HANDLER */ public void execute(ExecutionMessage executionMessage) { - this.execute( - executionMessage.getResultKey(), - executionMessage.getCommandList() + + // 防止阻塞消息队列中的其他信息,需要使用异步执行 + AgentCommonThreadPool.pool.submit( + () -> this.execute( + executionMessage.getResultKey(), + executionMessage.getCommandList() + ) ); } diff --git a/agent/src/main/java/io/wdd/agent/executor/FunctionExecutor.java b/agent/src/main/java/io/wdd/agent/executor/FunctionExecutor.java index f37f676..2ce28ff 100644 --- a/agent/src/main/java/io/wdd/agent/executor/FunctionExecutor.java +++ b/agent/src/main/java/io/wdd/agent/executor/FunctionExecutor.java @@ -2,6 +2,7 @@ package io.wdd.agent.executor; import com.alibaba.nacos.api.config.listener.Listener; import com.alibaba.nacos.api.exception.NacosException; +import io.wdd.agent.config.utils.AgentCommonThreadPool; import io.wdd.agent.config.utils.NacosConfigurationCollector; import io.wdd.common.beans.executor.ExecutionMessage; import lombok.extern.slf4j.Slf4j; @@ -44,7 +45,10 @@ public class FunctionExecutor { completeCommandList = ALL_FUNCTION_MAP.get(executionMessage.getType()); } - this.execute(resultKey, completeCommandList); + // 防止阻塞消息队列中的其他信息,需要使用异步执行 + AgentCommonThreadPool.pool.submit( + () -> this.execute(resultKey, completeCommandList) + ); } diff --git a/index.html b/index.html index b3cbb6d..5ff74d9 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,46 @@ + -
../ -octopus-agent-2022-12-26-16-00-00.jar 27-Dec-2022 07:01 46309416 -