This is an automated email from the ASF dual-hosted git repository.

jianbin pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/incubator-seata.git


The following commit(s) were added to refs/heads/2.x by this push:
     new 34990ebf17 optimize: fail fast, when all server channel not available 
(#7023)
34990ebf17 is described below

commit 34990ebf172d4df4632c9cf4b01be071f6f00909
Author: jsbxyyx <[email protected]>
AuthorDate: Mon Nov 25 14:33:41 2024 +0800

    optimize: fail fast, when all server channel not available (#7023)
---
 changes/en-us/2.x.md                                              | 3 ++-
 changes/zh-cn/2.x.md                                              | 5 ++++-
 .../apache/seata/core/rpc/netty/NettyClientChannelManager.java    | 2 ++
 .../apache/seata/server/controller/VGroupMappingController.java   | 8 --------
 4 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md
index 7033f80801..6e97f62977 100644
--- a/changes/en-us/2.x.md
+++ b/changes/en-us/2.x.md
@@ -51,7 +51,7 @@ Add changes here for all PR submitted to the 2.x branch.
 - [[#6993](https://github.com/apache/incubator-seata/pull/6993)] optimize 
transaction metrics
 - [[#6995](https://github.com/apache/incubator-seata/pull/6995)] upgrade 
outdate npmjs dependencies
 - [[#6996](https://github.com/apache/incubator-seata/pull/6996)] optimize lock 
release logic in AT transaction mode
-
+- [[#7023](https://github.com/apache/incubator-seata/pull/7023)] optimize fail 
fast, when all server not available
 
 ### refactor:
 
@@ -79,6 +79,7 @@ Thanks to these contributors for their code commits. Please 
report an unintended
 - [lixingjia77](https://github.com/lixingjia77)
 - [whaon](https://github.com/whaon)
 - [YvCeung](https://github.com/YvCeung)
+- [jsbxyyx](https://github.com/jsbxyyx)
 
 
 
diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md
index 93eea2911d..b6b2262c57 100644
--- a/changes/zh-cn/2.x.md
+++ b/changes/zh-cn/2.x.md
@@ -52,7 +52,9 @@
 - [[#6991](https://github.com/apache/incubator-seata/pull/6991)] 
gRPC协议序列化默认值为protobuf
 - [[#6996](https://github.com/apache/incubator-seata/pull/6996)] 优化 AT 
事务模式锁释放逻辑
 - [[#6993](https://github.com/apache/incubator-seata/pull/6993)] 优化 metrics 指标
-
+- [[#6995](https://github.com/apache/incubator-seata/pull/6995)] 升级过时的 npmjs 依赖
+- [[#6996](https://github.com/apache/incubator-seata/pull/6996)] 优化 AT 
事务模式锁释放逻辑
+- [[#7023](https://github.com/apache/incubator-seata/pull/7023)] 优化快速失败
 
 ### refactor:
 
@@ -83,6 +85,7 @@
 - [lixingjia77](https://github.com/lixingjia77)
 - [whaon](https://github.com/whaon)
 - [YvCeung](https://github.com/YvCeung)
+- [jsbxyyx](https://github.com/jsbxyyx)
 
 
 同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。
diff --git 
a/core/src/main/java/org/apache/seata/core/rpc/netty/NettyClientChannelManager.java
 
b/core/src/main/java/org/apache/seata/core/rpc/netty/NettyClientChannelManager.java
index 7be0de2e72..1ebd36fe45 100644
--- 
a/core/src/main/java/org/apache/seata/core/rpc/netty/NettyClientChannelManager.java
+++ 
b/core/src/main/java/org/apache/seata/core/rpc/netty/NettyClientChannelManager.java
@@ -247,6 +247,8 @@ class NettyClientChannelManager {
                                 FrameworkErrorCode.NetConnect.getErrCode(), 
key, value.getMessage(), value);
                     });
                 }
+            }
+            if (availList.size() == failedMap.size()) {
                 String invalidAddress = 
StringUtils.join(failedMap.keySet().iterator(), ", ");
                 throw new FrameworkException("can not connect to [" + 
invalidAddress + "]");
             }
diff --git 
a/server/src/main/java/org/apache/seata/server/controller/VGroupMappingController.java
 
b/server/src/main/java/org/apache/seata/server/controller/VGroupMappingController.java
index 09c3f8c788..1d55855f5d 100644
--- 
a/server/src/main/java/org/apache/seata/server/controller/VGroupMappingController.java
+++ 
b/server/src/main/java/org/apache/seata/server/controller/VGroupMappingController.java
@@ -18,7 +18,6 @@ package org.apache.seata.server.controller;
 
 import org.apache.seata.common.metadata.namingserver.Instance;
 import org.apache.seata.common.result.Result;
-import org.apache.seata.common.util.StringUtils;
 import org.apache.seata.config.Configuration;
 import org.apache.seata.config.ConfigurationFactory;
 import org.apache.seata.core.store.MappingDO;
@@ -29,13 +28,6 @@ import 
org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.annotation.PostConstruct;
-
-import static org.apache.seata.common.ConfigurationKeys.FILE_CONFIG_SPLIT_CHAR;
-import static org.apache.seata.common.ConfigurationKeys.FILE_ROOT_REGISTRY;
-import static org.apache.seata.common.ConfigurationKeys.FILE_ROOT_TYPE;
-import static org.apache.seata.common.ConfigurationKeys.NAMING_SERVER;
-
 @RestController
 @RequestMapping("/vgroup/v1")
 public class VGroupMappingController {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to