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