-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Comments
What version of the component are you using? |
该问题与当前Spring Cloud Alibaba配置监听逻辑实现有关,当前实现是启动时会主动订阅配置,配置变更后,再主动拉取新配置更新内存中所有对象配置值。在配置中心server多节点时当出现主动刷新配置操作请求的是未完成同步的实例会造成未正常更新配置现象(该问题Nacos Client 1.x短连接模式易出现,2.x长链接难出现,因为第一次接受配置变更通知与第二次主动拉取配置在长链接未发生断开情况下会一直使用同一个连接访问到对应产生配置更新的配置中心实例)。如果遇到相关问题,建议可以先按照版本说明进行升级,采用 Nacos Client 2.x版本可较大限度规避该问题。后续社区会对当前问题进行对应的修复。 |
他用的 2.1.1.RELEASE,对应的Nacos Client 为 1.x。 |
This issue has been open 30 days with no activity. This will be closed in 7 days. |
Ping |
This issue has been open 30 days with no activity. This will be closed in 7 days. |
keep it open |
This issue has been open 30 days with no activity. This will be closed in 7 days. |
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. |
problem is not solved |
This issue has been open 30 days with no activity. This will be closed in 7 days. |
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. |
i will solve it |
Spring Cloud Alibaba 2.1.1.RELEASE版本 + Nacos 组合,当 Nacos 配置有变更时, SCA 未正确收到配置变更。
spring-cloud-alibaba 框架未加载到正确配置
初步定位原因在spring-cloud-alibaba框架未正确处理nacos-client收到的配置推送
configInfo为最新的配置推送值,但此处sca的listener实现没有使用它,内容被丢弃。
查看代码确认SCA通过主动getConfig获取配置内容
重新获取配置有概率得到旧值
SCA收到更新事件后,直接使用getConfig得到配置内容可能是旧值(原因见后文图示)
通过服务端推送日志时间序列可以证实该种情况:
问题发生过程如下图所示:
The text was updated successfully, but these errors were encountered: