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

Spring-cloud-alibaba框架未正确处理nacos-client收到的配置推送 #3322

Closed
chickenlj opened this issue May 24, 2023 · 13 comments
Closed
Assignees
Labels
area/nacos spring cloud alibaba nacos component bug

Comments

@chickenlj
Copy link
Collaborator

chickenlj commented May 24, 2023

Spring Cloud Alibaba 2.1.1.RELEASE版本 + Nacos 组合,当 Nacos 配置有变更时, SCA 未正确收到配置变更。

spring-cloud-alibaba 框架未加载到正确配置

初步定位原因在spring-cloud-alibaba框架未正确处理nacos-client收到的配置推送

image

configInfo为最新的配置推送值,但此处sca的listener实现没有使用它,内容被丢弃。
查看代码确认SCA通过主动getConfig获取配置内容

image

重新获取配置有概率得到旧值

SCA收到更新事件后,直接使用getConfig得到配置内容可能是旧值(原因见后文图示)

通过服务端推送日志时间序列可以证实该种情况:

2023-05-22 11:31:39,487  pod-4 persist

2023-05-22 11:31:39,505  pod-3 dump (将最新配置推送给客户端)

2023-05-22 11:31:39,513  pod-0 pull (收到变更推送时没有使用新值,主动查询时查到了pod-0的旧值)

2023-05-22 11:31:39,516  pod-0 pull

....

2023-05-22 11:31:39,526  pod-4 dump

2023-05-22 11:31:39,529  pod-2 dump

2023-05-22 11:31:40,540  pod-0 dump

2023-05-22 11:31:39,585  pod-1 dump

问题发生过程如下图所示:

image

@yuluo-yx
Copy link
Collaborator

What version of the component are you using?

@steverao
Copy link
Collaborator

该问题与当前Spring Cloud Alibaba配置监听逻辑实现有关,当前实现是启动时会主动订阅配置,配置变更后,再主动拉取新配置更新内存中所有对象配置值。在配置中心server多节点时当出现主动刷新配置操作请求的是未完成同步的实例会造成未正常更新配置现象(该问题Nacos Client 1.x短连接模式易出现,2.x长链接难出现,因为第一次接受配置变更通知与第二次主动拉取配置在长链接未发生断开情况下会一直使用同一个连接访问到对应产生配置更新的配置中心实例)。如果遇到相关问题,建议可以先按照版本说明进行升级,采用 Nacos Client 2.x版本可较大限度规避该问题。后续社区会对当前问题进行对应的修复。

@steverao
Copy link
Collaborator

What version of the component are you using?

他用的 2.1.1.RELEASE,对应的Nacos Client 为 1.x。

@github-actions
Copy link

github-actions bot commented Jul 8, 2023

This issue has been open 30 days with no activity. This will be closed in 7 days.

@github-actions github-actions bot added the stale label Jul 8, 2023
@chickenlj
Copy link
Collaborator Author

Ping

@github-actions github-actions bot removed the stale label Jul 10, 2023
@github-actions
Copy link

This issue has been open 30 days with no activity. This will be closed in 7 days.

@github-actions github-actions bot added the stale label Aug 10, 2023
@chickenlj
Copy link
Collaborator Author

keep it open

@github-actions github-actions bot removed the stale label Aug 12, 2023
@github-actions
Copy link

This issue has been open 30 days with no activity. This will be closed in 7 days.

@github-actions github-actions bot added the stale label Sep 17, 2023
@github-actions
Copy link

This issue has been automatically marked as stale because it hasn't had any recent activity.If you think this should still be open, or the problem still persists, just pop a reply in the comments and one of the maintainers will (try!) to follow up. Thank you for your interest and contribution to the Sping Cloud Alibaba Community.

@shiyiyue1102
Copy link
Contributor

problem is not solved

Copy link

This issue has been open 30 days with no activity. This will be closed in 7 days.

@github-actions github-actions bot added the stale label Jan 10, 2024
Copy link

This issue has been automatically marked as stale because it hasn't had any recent activity.If you think this should still be open, or the problem still persists, just pop a reply in the comments and one of the maintainers will (try!) to follow up. Thank you for your interest and contribution to the Sping Cloud Alibaba Community.

@ruansheng8
Copy link
Collaborator

i will solve it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/nacos spring cloud alibaba nacos component bug
Projects
None yet
Development

No branches or pull requests

6 participants