You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by xi...@apache.org on 2024/10/25 05:24:16 UTC

(incubator-seata) branch 2.x updated: bugfix: fix npe for nacos registry when look up address (#6947)

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

xingfudeshi 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 e91e1131e5 bugfix: fix npe for nacos registry when look up address (#6947)
e91e1131e5 is described below

commit e91e1131e59eea0d5bbfed331232018902f433f9
Author: laywin <la...@yeah.net>
AuthorDate: Fri Oct 25 13:24:11 2024 +0800

    bugfix: fix npe for nacos registry when look up address (#6947)
---
 changes/en-us/2.x.md                                                     | 1 +
 changes/zh-cn/2.x.md                                                     | 1 +
 .../apache/seata/discovery/registry/nacos/NacosRegistryServiceImpl.java  | 1 +
 3 files changed, 3 insertions(+)

diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md
index 3fc4fce793..5bdcb56227 100644
--- a/changes/en-us/2.x.md
+++ b/changes/en-us/2.x.md
@@ -17,6 +17,7 @@ Add changes here for all PR submitted to the 2.x branch.
 - [[#6932](https://github.com/apache/incubator-seata/pull/6932)] when enabling local transactions, the lock contention failure in file & raft mode does not exit, leading to a lingering lock
 - [[#6940](https://github.com/apache/incubator-seata/pull/6940)] Fix NacosRegistry lookup behavior transactionServiceGroup is empty causing NPE error
 - [[#6943](https://github.com/apache/incubator-seata/pull/6943)] fix the conversion error for `convertBranchSession` in concurrent environment.
+- [[#6947](https://github.com/apache/incubator-seata/pull/6947)] fix npe for nacos registry when look up address
 
 ### optimize:
 - [[#6826](https://github.com/apache/incubator-seata/pull/6826)] remove the branch registration operation of the XA read-only transaction
diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md
index 41b0965f39..efb6cad9b7 100644
--- a/changes/zh-cn/2.x.md
+++ b/changes/zh-cn/2.x.md
@@ -17,6 +17,7 @@
 - [[#6932](https://github.com/apache/incubator-seata/pull/6932)] 修复开启本地事务时file&raft模式下锁争抢失败未退出导致可能出现残留锁
 - [[#6940](https://github.com/apache/incubator-seata/pull/6940)] 修复NacosRegistry lookup 行为 transactionServiceGroup 为空导致 NPE 错误
 - [[#6943](https://github.com/apache/incubator-seata/pull/6943)] 修复并发状态下 `convertBranchSession` 转换报错问题
+- [[#6947](https://github.com/apache/incubator-seata/pull/6947)] 修复nacos注册中心查询可用地址时的空指针问题
 
 ### optimize:
 - [[#6826](https://github.com/apache/incubator-seata/pull/6826)] 移除只读XA事务的分支注册操作
diff --git a/discovery/seata-discovery-nacos/src/main/java/org/apache/seata/discovery/registry/nacos/NacosRegistryServiceImpl.java b/discovery/seata-discovery-nacos/src/main/java/org/apache/seata/discovery/registry/nacos/NacosRegistryServiceImpl.java
index 1d19d8814d..5edfaed70d 100644
--- a/discovery/seata-discovery-nacos/src/main/java/org/apache/seata/discovery/registry/nacos/NacosRegistryServiceImpl.java
+++ b/discovery/seata-discovery-nacos/src/main/java/org/apache/seata/discovery/registry/nacos/NacosRegistryServiceImpl.java
@@ -147,6 +147,7 @@ public class NacosRegistryServiceImpl implements RegistryService<EventListener>
 
     @Override
     public List<InetSocketAddress> lookup(String key) throws Exception {
+        transactionServiceGroup = key;
         String clusterName = getServiceGroup(key);
         if (clusterName == null) {
             String missingDataId = PREFIX_SERVICE_ROOT + CONFIG_SPLIT_CHAR + PREFIX_SERVICE_MAPPING + key;


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org