[server] [rpc] - 修复rpc返回信息处理逻辑, 解决cpu过高的问题 - 1
This commit is contained in:
14
.run/Server-dev.run.xml
Normal file
14
.run/Server-dev.run.xml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Server-dev" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" activateToolWindowBeforeRun="false">
|
||||||
|
<option name="HIDE_BANNER" value="true" />
|
||||||
|
<module name="server" />
|
||||||
|
<selectedOptions>
|
||||||
|
<option name="spring.boot.profiles" visible="false" />
|
||||||
|
</selectedOptions>
|
||||||
|
<option name="SPRING_BOOT_MAIN_CLASS" value="io.wdd.ServerApplication" />
|
||||||
|
<option name="VM_PARAMETERS" value="-Dfile.encoding=utf-8 -Dspring.profiles.active=dev -Dspring.cloud.nacos.config.group=dev -Dspring.cloud.nacos.config.extension-configs[0].dataId=common-dev.yaml -Dspring.cloud.nacos.config.extension-configs[0].group=dev" />
|
||||||
|
<method v="2">
|
||||||
|
<option name="Make" enabled="true" />
|
||||||
|
</method>
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
13
.run/Server-k3s.run.xml
Normal file
13
.run/Server-k3s.run.xml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Server-k3s" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
|
||||||
|
<module name="server" />
|
||||||
|
<selectedOptions>
|
||||||
|
<option name="spring.boot.profiles" visible="false" />
|
||||||
|
</selectedOptions>
|
||||||
|
<option name="SPRING_BOOT_MAIN_CLASS" value="io.wdd.ServerApplication" />
|
||||||
|
<option name="VM_PARAMETERS" value="-Dfile.encoding=utf-8 -Dspring.profiles.active=k3s -Dspring.cloud.nacos.config.group=k3s -Dspring.cloud.nacos.config.extension-configs[0].dataId=common-k3s.yaml -Dspring.cloud.nacos.config.extension-configs[0].group=k3s" />
|
||||||
|
<method v="2">
|
||||||
|
<option name="Make" enabled="true" />
|
||||||
|
</method>
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
@@ -39,4 +39,6 @@
|
|||||||
132.145.28.48 London-arm64-02 london-4 l4
|
132.145.28.48 London-arm64-02 london-4 l4
|
||||||
|
|
||||||
# 所有的主机
|
# 所有的主机
|
||||||
Phoenix-amd64-02,Phoenix-arm64-01,Phoenix-arm64-02,London-amd64-01,London-amd64-02,London-arm64-01,London-arm64-02
|
Phoenix-amd64-02,Phoenix-arm64-01,Phoenix-arm64-02,London-amd64-01,London-amd64-02,London-arm64-01,London-arm64-02
|
||||||
|
|
||||||
|
Tokyo-amd64-13-6e8a19, Tokyo-amd64-07-f66a41, Phoenix-arm64-01-52c2f4, Phoenix-amd64-02-2a45bb, Phoenix-arm64-02-7b95ac, London-arm64-02-9ee6ba, London-amd64-01-0b219f, London-amd64-02-c155d1, London-arm64-01-72519e
|
||||||
@@ -19,6 +19,9 @@ spring:
|
|||||||
- group: local
|
- group: local
|
||||||
data-id: common-local.yaml
|
data-id: common-local.yaml
|
||||||
|
|
||||||
|
server:
|
||||||
|
port: 8000
|
||||||
|
|
||||||
#debug: true
|
#debug: true
|
||||||
#logging:
|
#logging:
|
||||||
# level:
|
# level:
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ public class OctopusAgentServiceImpl implements OctopusAgentService {
|
|||||||
);
|
);
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
// 超时等待5秒钟, 或者所有的Agent均已经完成上报
|
// 超时等待5秒钟, 或者所有的Agent均已经完成上报ddo
|
||||||
countDownLatch.await(
|
countDownLatch.await(
|
||||||
5,
|
5,
|
||||||
TimeUnit.SECONDS
|
TimeUnit.SECONDS
|
||||||
@@ -242,7 +242,6 @@ public class OctopusAgentServiceImpl implements OctopusAgentService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String shutdownAgentDanger(String agentTopicName) {
|
public String shutdownAgentDanger(String agentTopicName) {
|
||||||
|
|
||||||
@@ -293,11 +292,9 @@ public class OctopusAgentServiceImpl implements OctopusAgentService {
|
|||||||
)) {
|
)) {
|
||||||
|
|
||||||
// 不是当前应用需要的的OM,将信息放置与Cache队列的末尾
|
// 不是当前应用需要的的OM,将信息放置与Cache队列的末尾
|
||||||
try {
|
|
||||||
OCTOPUS_MESSAGE_FROM_AGENT.put(message);
|
OCTOPUS_MESSAGE_FROM_AGENT.offer(message);
|
||||||
} catch (InterruptedException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
// 返回,继续死循环
|
// 返回,继续死循环
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -346,11 +343,9 @@ public class OctopusAgentServiceImpl implements OctopusAgentService {
|
|||||||
)) {
|
)) {
|
||||||
|
|
||||||
// 不是当前应用需要的的OM,将信息放置与Cache队列的末尾
|
// 不是当前应用需要的的OM,将信息放置与Cache队列的末尾
|
||||||
try {
|
|
||||||
OCTOPUS_MESSAGE_FROM_AGENT.put(message);
|
OCTOPUS_MESSAGE_FROM_AGENT.offer(message);
|
||||||
} catch (InterruptedException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
// 返回,继续死循环
|
// 返回,继续死循环
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,6 +73,9 @@ public class AsyncWaitOMResult {
|
|||||||
);
|
);
|
||||||
if (!REPLAY_CACHE_MAP.containsKey(matchKey)) {
|
if (!REPLAY_CACHE_MAP.containsKey(matchKey)) {
|
||||||
// 没有这个Key,说明等待结果已经超时了,直接丢弃,然后继续循环
|
// 没有这个Key,说明等待结果已经超时了,直接丢弃,然后继续循环
|
||||||
|
|
||||||
|
// todo 错误的数据需要放置于某处
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import org.springframework.data.redis.core.RedisTemplate;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayDeque;
|
||||||
import java.util.concurrent.ArrayBlockingQueue;
|
import java.util.concurrent.ArrayBlockingQueue;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@@ -29,9 +30,8 @@ public class OMessageHandlerServer {
|
|||||||
* 各个业务模块需要自己手动去获取自己需要的内容
|
* 各个业务模块需要自己手动去获取自己需要的内容
|
||||||
* TODO 数据一致性问题,当AgentShutDown可能有一些信息会消失
|
* TODO 数据一致性问题,当AgentShutDown可能有一些信息会消失
|
||||||
*/
|
*/
|
||||||
public static ArrayBlockingQueue<OctopusMessage> OCTOPUS_MESSAGE_FROM_AGENT = new ArrayBlockingQueue<>(
|
public static ArrayDeque<OctopusMessage> OCTOPUS_MESSAGE_FROM_AGENT = new ArrayDeque<>(
|
||||||
128,
|
128
|
||||||
true
|
|
||||||
);
|
);
|
||||||
@Resource
|
@Resource
|
||||||
RedisTemplate redisTemplate;
|
RedisTemplate redisTemplate;
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class QuartzSchedulerServiceImpl implements QuartzSchedulerService {
|
|||||||
futureExecutionResultKey
|
futureExecutionResultKey
|
||||||
);
|
);
|
||||||
|
|
||||||
log.info("[ 定时脚本任务 ] - 新建任务成功, 船舰任务DTO为 => {}", scriptSchedulerDTO);
|
log.info("[ 定时脚本任务 ] - 新建任务成功, 任务DTO为 => {}", scriptSchedulerDTO);
|
||||||
log.info("[ 定时脚本任务 ] - 新建任务成功, 任务内容为 => {}", jobDetail);
|
log.info("[ 定时脚本任务 ] - 新建任务成功, 任务内容为 => {}", jobDetail);
|
||||||
|
|
||||||
// persistent the script scheduled mission
|
// persistent the script scheduled mission
|
||||||
|
|||||||
@@ -18,3 +18,6 @@ spring:
|
|||||||
extension-configs:
|
extension-configs:
|
||||||
- group: local
|
- group: local
|
||||||
data-id: common-local.yaml
|
data-id: common-local.yaml
|
||||||
|
|
||||||
|
server:
|
||||||
|
port: 9999
|
||||||
Reference in New Issue
Block a user