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

通过环境变量设置nacos.naming.client.expired.time不生效 #8050

Closed
chensiyu123456 opened this issue Mar 31, 2022 · 1 comment · Fixed by #8055
Closed

通过环境变量设置nacos.naming.client.expired.time不生效 #8050

chensiyu123456 opened this issue Mar 31, 2022 · 1 comment · Fixed by #8055
Labels
kind/bug Category issues or prs related to bug.
Milestone

Comments

@chensiyu123456
Copy link

环境信息:
nacos服务端版本:2.0.3,
客户端使用:spring-cloud-starter-alibaba-nacos-discovery的2.2.5.RELEASE

现象:

通过源码启动nacos,并通过环境变量注入nacos.naming.client.expired.time设置为较长
image

注册临时服务,等服务上线后,停掉临时服务。在服务端进行检查时候,如图会检测客户端的过期时间,通过获取ClientConfig的实例得到该参数
image
但在ClientConfig代码中,初始化该对象时候调用了父类AbstractDynamicConfig的resetConfig()方法并通过子类的getConfigFromEnv()方法从环境变量中获取到了nacos.naming.client.expired.time的值并赋给clientExpiredTime,但子类ClientConfig初始化过程中又重置了clientExpiredTime为默认的3分钟。导致无论如何都无法通过环境变量设置该值
企业微信截图_ba23aa4e-d2b9-4c0f-8db4-28cdc9e7be1a

@onewe
Copy link
Collaborator

onewe commented Mar 31, 2022

@onewe will resolve it@

@KomachiSion KomachiSion added the kind/bug Category issues or prs related to bug. label Apr 7, 2022
@KomachiSion KomachiSion added this to the 2.1.0 milestone Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Category issues or prs related to bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants