-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
[BUG]偶发获取配置卡住 #90
Comments
这个是偶发的,我程序启动时会先读取Apollo读取配置,有些时候发现程序已启动就卡在那里不动了。我觉得可能是你那个apolloConfigCache锁住了,或者就是可能网络连不通一直在重试 |
你连的namespace有没有不存在的?有用自定义log来打日志么? |
加了log之后打印了这个
|
这个问题调试起来很蛋疼,用idea去debug跑每次都没问题,编译成可执行文件然后运行才会出现这个问题.... |
agollo.GetConfig(namespace)如果,这个一直卡住,有可能是2个问题造成
我个人觉得是第一个问题居多,第一个问题我现在虽然做了异步,但是没设置超时所以可能会导致阻塞,你觉得像哪个问题,我模拟一下场景。 |
兄嘚,我调了半天,你看下https://github.com/zouyx/agollo/blob/master/repository.go#L112 为啥会锁住,这个wait要wait多久。 |
那就是第二个,namespace初始化没成功......https://github.com/zouyx/agollo/blob/22f6ac5189d6e3a071055d0ce7157254117d2a69/repository.go#L278 |
https://github.com/zouyx/agollo/blob/22f6ac5189d6e3a071055d0ce7157254117d2a69/componet_notify.go#L91, 这里会修改全局变量allNotifications,函数initNamespaceNotifications不应该做这件事。 |
谢谢建议,我尽量这周抽时间看看 |
Ref #91 |
v2.2.6 |
agollo.GetConfig(namespace)一直卡住
如果是在重试从Apollo服务器获取配置,希望能加点log,至少让开发人员知道发生了啥。
The text was updated successfully, but these errors were encountered: