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

1.3.2nacos<--->2.2.3nacos双向同步时,暂停其中的一个task,重启jvm会抛出空指针 异常 #337 #338

Closed
wants to merge 5 commits into from

Conversation

xiaoquanidea
Copy link

@xiaoquanidea xiaoquanidea commented Nov 3, 2023

环境:有A(nacos1.3.2)和B(nacos2.2.3)两个集群,为A集群创建namespace名为aNamesparce,为B集群创建namespace为bNamespace,在nacos-sync中创建两个task,分别是A->B和B->A双向同步,serviceName均设置为ALL用以同步所有。

问题1:如果将B->A的同步任务暂停(暂停A->B的也可以),然后重启jvm,QuerySyncTaskTimer类会扫描到DELETE的task,发送DeleteTaskEvent,在listener中监听并调用NacosSyncToNacosServiceImpl#delete方法,方法中会调用popNamingService方法获取namingService(从serviceClient Map中获取),因为这个serviceClient Map的存储在该版本中只有在sync的listener中才会put,这个DELTE task就永远获取不到namingService,会直接抛出NPE。
image
image

问题2:如果暂停成功,则老的实例不会被注销掉。如下图所示:
这个serviceClient去重有4个namingService,任务10有两个分别是各个服务引用的NacosNamingService@2b056461和ALL引用的NacosNamingService@7c95663,任务11也有两个,分别是各个服务引用的NacosNamingService@75beac01和ALL引用的NacosNamingService@4dea1449,如果任务名为ALL的话,会获取到单独的ALL namingService,服务注册不是通过ALL注册的,所以注销会失败,服务不会下线,修复完成之后一切正常。
image
image

问题3:如果注册的服务没有元数据,ServiceInfo接口返回的json中,Instance的metadata属性被指定为null,导致NPE;
image

@xiaoquanidea xiaoquanidea reopened this Nov 3, 2023
@xiaoquanidea
Copy link
Author

xiaoquanidea commented Nov 3, 2023

@paderlol @wyp12 @loadchange 大哥们,看一下

@xiaoquanidea xiaoquanidea marked this pull request as draft November 3, 2023 11:41
@xiaoquanidea xiaoquanidea marked this pull request as ready for review November 3, 2023 11:44
@xiaoquanidea
Copy link
Author

#337

@zrlw
Copy link
Contributor

zrlw commented Nov 4, 2023

好像普通Contributor不能提PR到master,只能先提交PR到develop分支,社区Committer成员复核通过合并到develop,最后由Member定期审核develop并合并到master吧。
不过近几个月的issue和pr貌似没有Committer出来回应,不清楚社区出了什么情况。

@paderlol paderlol requested review from paderlol and wyp12 November 9, 2023 09:22
@paderlol
Copy link
Contributor

paderlol commented Nov 9, 2023

好像普通Contributor不能提PR到master,只能先提交PR到develop分支,社区Committer成员复核通过合并到develop,最后由Member定期审核develop并合并到master吧。 不过近几个月的issue和pr貌似没有Committer出来回应,不清楚社区出了什么情况。

忙自己公司的事情去了,不好意思. 有急事可以直接钉钉找我

@paderlol
Copy link
Contributor

paderlol commented Nov 9, 2023

请不要提交PR到master, 暂时先关闭了

@paderlol paderlol closed this Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants