Skip to content

Commit 90f3cf4

Browse files
authored
bugfix: the server does not send heartbeats when the namingserver is used with other registries (#7529)
1 parent 9636fc2 commit 90f3cf4

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

changes/en-us/2.x.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Add changes here for all PR submitted to the 2.x branch.
3535
- [[#7502](https://github.com/apache/incubator-seata/pull/7502)] remove extra dots and keep the naming style consistent with other tables
3636
- [[#7498](https://github.com/apache/incubator-seata/pull/7498)] fix the class name whitelist check issue in fury deserialization
3737
- [[#7504](https://github.com/apache/incubator-seata/pull/7504)] fix load driver class in Hikari
38+
- [[#7512](https://github.com/apache/incubator-seata/pull/7512)] fix the server does not send heartbeats when the namingserver is used with other registries
3839

3940

4041
### optimize:

changes/zh-cn/2.x.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
- [[#7502](https://github.com/apache/incubator-seata/pull/7502)] 删除多余点号和保持命名规范统一
3636
- [[#7498](https://github.com/apache/incubator-seata/pull/7498)] 修复fury反序列化的类名白名单检查问题
3737
- [[#7504](https://github.com/apache/incubator-seata/pull/7504)] 修复 Hikari 中的加载驱动程序类
38+
- [[#7512](https://github.com/apache/incubator-seata/pull/7512)] 修复多注册中心下server不会向namingserver发送心跳的问题
3839

3940

4041
### optimize:

server/src/main/java/org/apache/seata/server/instance/AbstractSeataInstanceStrategy.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import org.apache.seata.common.metadata.Instance;
2020
import org.apache.seata.common.thread.NamedThreadFactory;
21-
import org.apache.seata.common.util.StringUtils;
2221
import org.apache.seata.server.session.SessionHolder;
2322
import org.apache.seata.server.store.VGroupMappingStoreManager;
2423
import org.apache.seata.spring.boot.autoconfigure.properties.registry.RegistryNamingServerProperties;
@@ -31,6 +30,7 @@
3130
import javax.annotation.PostConstruct;
3231
import javax.annotation.PreDestroy;
3332
import javax.annotation.Resource;
33+
import java.util.Arrays;
3434
import java.util.Optional;
3535
import java.util.concurrent.ScheduledExecutorService;
3636
import java.util.concurrent.ScheduledThreadPoolExecutor;
@@ -64,7 +64,8 @@ public void postConstruct() {
6464

6565
@Override
6666
public void init() {
67-
if (!StringUtils.equals(registryProperties.getType(), NAMING_SERVER)) {
67+
String types = registryProperties.getType();
68+
if (types == null || !Arrays.asList(types.split(",")).contains(NAMING_SERVER)) {
6869
return;
6970
}
7071
Instance instance = serverInstanceInit();

0 commit comments

Comments
 (0)