[server] - 修改 线程爆炸的bug -1
This commit is contained in:
@@ -7,7 +7,6 @@ import io.wdd.common.beans.rabbitmq.OctopusMessage;
|
||||
import io.wdd.common.beans.rabbitmq.OctopusMessageType;
|
||||
import io.wdd.common.handler.MyRuntimeException;
|
||||
import io.wdd.rpc.execute.config.ExecutionLog;
|
||||
import io.wdd.rpc.execute.result.BuildStreamReader;
|
||||
import io.wdd.rpc.message.sender.OMessageToAgentSender;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -20,25 +19,20 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static io.wdd.rpc.execute.service.ExecutionResultDaemonHandler.WAIT_EXECUTION_RESULT_LIST;
|
||||
import static io.wdd.rpc.init.ServerBootUpEnvironment.ALL_AGENT_TOPIC_NAME_LIST;
|
||||
import static io.wdd.rpc.init.ServerBootUpEnvironment.ALL_AGENT_TOPIC_NAME_SET;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class CoreExecutionServiceImpl implements CoreExecutionService {
|
||||
|
||||
private static final String MANUAL_COMMAND_TYPE = "manual-command";
|
||||
@Resource
|
||||
OMessageToAgentSender oMessageToAgentSender;
|
||||
|
||||
@Resource
|
||||
ObjectMapper objectMapper;
|
||||
|
||||
@Resource
|
||||
RedisTemplate redisTemplate;
|
||||
|
||||
private static final String MANUAL_COMMAND_TYPE = "manual-command";
|
||||
|
||||
@Override
|
||||
public String SendCommandToAgent(String agentTopicName, String command) {
|
||||
return this.SendCommandToAgent(
|
||||
@@ -90,7 +84,10 @@ public class CoreExecutionServiceImpl implements CoreExecutionService {
|
||||
|
||||
// 检查agentTopicName是否存在
|
||||
if (!ALL_AGENT_TOPIC_NAME_SET.contains(agentTopicName)) {
|
||||
log.error("agentTopicName异常! 输入为 => {}", agentTopicName);
|
||||
log.error(
|
||||
"agentTopicName异常! 输入为 => {}",
|
||||
agentTopicName
|
||||
);
|
||||
throw new MyRuntimeException("agentTopicName异常!" + agentTopicName);
|
||||
}
|
||||
|
||||
@@ -140,10 +137,11 @@ public class CoreExecutionServiceImpl implements CoreExecutionService {
|
||||
executionMessage
|
||||
);
|
||||
// send resultKey to ExecutionResultDaemonHandler
|
||||
WAIT_EXECUTION_RESULT_LIST.put(
|
||||
// 当批量执行,产生大量的resultKey的时候,会出现线程爆炸,导致所有的全部失效
|
||||
/*WAIT_EXECUTION_RESULT_LIST.put(
|
||||
resultKey,
|
||||
executionLog
|
||||
);
|
||||
);*/
|
||||
|
||||
// help gc
|
||||
executionMessage = null;
|
||||
|
||||
@@ -8,6 +8,7 @@ import io.wdd.rpc.execute.result.BuildStreamReader;
|
||||
import io.wdd.server.service.ExecutionLogService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
@@ -24,6 +25,8 @@ import java.util.concurrent.*;
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@Lazy
|
||||
@Deprecated
|
||||
public class ExecutionResultDaemonHandler {
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user