[Optimize]Topic-Partitions增加主动超时功能 (#1076)

问题:
leader=-1的分区获取offset信息时,耗时时间过久会导致前端超时,进而整个页面的数据都获取不到;

解决:
后端主动在前端超时前,对一些请求进行超时,避免导致所有的信息都没有返回给前端;
This commit is contained in:
EricZeng
2023-07-04 14:18:12 +08:00
committed by GitHub
parent 49e7fea6d3
commit abaadfb9a8
4 changed files with 42 additions and 29 deletions

View File

@@ -74,7 +74,7 @@ public class TopicStateController {
@GetMapping(value = "clusters/{clusterPhyId}/topics/{topicName}/brokers-partitions-summary")
@ResponseBody
public Result<TopicBrokersPartitionsSummaryVO> getTopicBrokersPartitionsSummary(@PathVariable Long clusterPhyId,
@PathVariable String topicName) throws Exception {
@PathVariable String topicName) {
return topicStateManager.getTopicBrokersPartitionsSummary(clusterPhyId, topicName);
}
@@ -83,7 +83,7 @@ public class TopicStateController {
@ResponseBody
public Result<List<TopicPartitionVO>> getTopicPartitions(@PathVariable Long clusterPhyId,
@PathVariable String topicName,
@RequestBody List<String> metricsNames) throws Exception {
@RequestBody List<String> metricsNames) {
return topicStateManager.getTopicPartitions(clusterPhyId, topicName, metricsNames);
}