Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #13138] fix processServiceInfo bug #13137

Merged
merged 6 commits into from
Mar 3, 2025

Conversation

luky116
Copy link
Contributor

@luky116 luky116 commented Feb 26, 2025

Please do not create a Pull Request without creating an issue first.

What is the purpose of the change

当前 nacos client 会接收一个 service 所有 cluster 的推送,然后在本地根据 clusters 选择 listerner 进行回调。所以,serviceInfoHolder 中的 map,直接存储 groupName@@serviceName 作为 key 就行了,不需要加上 clusters。

另外,代码中从 serviceInfoHolder 获取 value 的时候,也没有传 clusters,所以存的时候不能加 clusters 存储,可能导致问题
image

The current nacos client will receive pushes from all clusters in a service, and then select listener locally according to clusters to perform callbacks. Therefore, just store groupName@@serviceName as key in serviceInfoHolder, and you don't need to add clusters.

$$ In addition, when the value is obtained from serviceInfoHolder in the code, clusters are not passed, so clusters cannot be added when saving, which may cause problems.

Brief changelog

XX

Verifying this change

XXXX

Follow this checklist to help us incorporate your contribution quickly and easily:

  • [*] Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • [*] Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • [*] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • [*] Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • [*] Run mvn -B clean package apache-rat:check findbugs:findbugs -Dmaven.test.skip=true to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.

@luky116 luky116 changed the title fix processServiceInfo bug [bugfix] fix processServiceInfo bug Feb 26, 2025
Copy link

Thanks for your this PR. 🙏
Please check again for your PR changes whether contains any usage/api/configuration change such as Add new API , Add new configuration, Change default value of configuration.
If so, please add or update documents(markdown type) in docs/next/ for repository nacos-group/nacos-group.github.io


感谢您提交的PR。 🙏
请再次查看您的PR内容,确认是否包含任何使用方式/API/配置参数的变更,如:新增API新增配置参数修改默认配置等操作。
如果是,请确保在提交之前,在仓库nacos-group/nacos-group.github.io中的docs/next/目录下添加或更新文档(markdown格式)。

@luky116 luky116 changed the title [bugfix] fix processServiceInfo bug [ISSUE #13138] fix processServiceInfo bug Feb 26, 2025
@CLAassistant
Copy link

CLAassistant commented Feb 26, 2025

CLA assistant check
All committers have signed the CLA.

@luky116
Copy link
Contributor Author

luky116 commented Feb 26, 2025

fix:#13137

@KiteSoar
Copy link
Contributor

@luky116 哈喽,提交代码需要先签一下CIA

@KomachiSion
Copy link
Collaborator

另外CI没过, 也需要fix一下

@KomachiSion KomachiSion added kind/enhancement Category issues or prs related to enhancement. area/Naming area/Client Related to Nacos Client SDK labels Feb 27, 2025
@KomachiSion KomachiSion added this to the 2.5.1 milestone Feb 27, 2025
@luky116 luky116 force-pushed the fix-processServiceInfoBug branch from 3b107c4 to 1262ee7 Compare March 2, 2025 15:04
@luky116
Copy link
Contributor Author

luky116 commented Mar 2, 2025

@luky116 哈喽,提交代码需要先签一下CIA

ok, i have signed CLA

luky116 added 4 commits March 2, 2025 23:24
…processServiceInfoBug2

# Conflicts:
#	client/src/main/java/com/alibaba/nacos/client/naming/cache/ServiceInfoHolder.java
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.

Project coverage is 72.17%. Comparing base (e6f46f0) to head (9319f65).
Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
...com/alibaba/nacos/api/naming/pojo/ServiceInfo.java 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             develop   #13137      +/-   ##
=============================================
- Coverage      72.27%   72.17%   -0.10%     
+ Complexity     10034    10014      -20     
=============================================
  Files           1310     1310              
  Lines          42016    42028      +12     
  Branches        4416     4417       +1     
=============================================
- Hits           30366    30333      -33     
- Misses          9556     9609      +53     
+ Partials        2094     2086       -8     
Files with missing lines Coverage Δ
...libaba/nacos/client/naming/NacosNamingService.java 93.95% <100.00%> (ø)
...a/nacos/client/naming/cache/ServiceInfoHolder.java 93.65% <100.00%> (-0.20%) ⬇️
...com/alibaba/nacos/api/naming/pojo/ServiceInfo.java 92.22% <0.00%> (-1.04%) ⬇️

... and 39 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e6f46f0...9319f65. Read the comment docs.

@luky116
Copy link
Contributor Author

luky116 commented Mar 2, 2025

另外CI没过, 也需要fix一下

修复了,辛苦再看下

@KomachiSion KomachiSion linked an issue Mar 3, 2025 that may be closed by this pull request
@KomachiSion KomachiSion merged commit fa79474 into alibaba:develop Mar 3, 2025
7 checks passed
@wuyfee
Copy link

wuyfee commented Mar 3, 2025

$\color{red}{FAILURE}$
DETAILS
✅ - docker: success
❌ - deploy (standalone & cluster & standalone_auth): failure
❌ - e2e-java-test (standalone & cluster & standalone_auth): skipped
❌ - e2e-go-test (standalone & cluster): skipped
❌ - e2e-cpp-test (standalone & cluster): skipped
❌ - e2e-csharp-test (standalone & cluster): skipped
❌ - e2e-nodejs-test (standalone & cluster): skipped
❌ - e2e-python-test (standalone & cluster): skipped
✅ - clean (standalone & cluster & standalone_auth): success

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/Client Related to Nacos Client SDK area/Naming kind/enhancement Category issues or prs related to enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

processServiceInfo 逻辑有一个 BUG
6 participants