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

ZookeeperRegistry ->doRegister 方法 faultTolerant参数 设置为false,是不是会存在问题 ? #12646

Closed
1 task done
qijun4tian opened this issue Jul 3, 2023 · 4 comments

Comments

@qijun4tian
Copy link
Contributor

qijun4tian commented Jul 3, 2023

  • I have searched the issues of this repository and believe that this is not a duplicate.

Ask your question here

这个问题中

在provider 恢复zk 链接后
日志如下

2023-06-27 19:24:53.473 [main-EventThread] INFO  org.apache.curator.framework.state.ConnectionStateManager [postState:251] - State change: RECONNECTED

FailbackRegistry 尝试去恢复链接 会调用 addFailedRegistered 加入到HashedWheelTimer
HashedWheelTimer 最后尝试去重新注册的时候提示node 已经存在

	at org.apache.zookeeper.KeeperException.create(KeeperException.java:119)
	at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
	at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:783)
	at org.apache.curator.framework.imps.CreateBuilderImpl$17.call(CreateBuilderImpl.java:1176)
	at org.apache.curator.framework.imps.CreateBuilderImpl$17.call(CreateBuilderImpl.java:1156)
	at org.apache.curator.connection.StandardConnectionHandlingPolicy.callWithRetry(StandardConnectionHandlingPolicy.java:64)
	at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:100)
	at org.apache.curator.framework.imps.CreateBuilderImpl.pathInForeground(CreateBuilderImpl.java:1153)
	at org.apache.curator.framework.imps.CreateBuilderImpl.protectedPathInForeground(CreateBuilderImpl.java:607)
	at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:597)
	at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:575)
	at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:51)
	at org.apache.dubbo.remoting.zookeeper.curator.CuratorZookeeperClient.createEphemeral(CuratorZookeeperClient.java:138)
	at org.apache.dubbo.remoting.zookeeper.AbstractZookeeperClient.create(AbstractZookeeperClient.java:87)
	at org.apache.dubbo.registry.zookeeper.ZookeeperRegistry.doRegister(ZookeeperRegistry.java:161)
	at org.apache.dubbo.registry.retry.FailedRegisteredTask.doRetry(FailedRegisteredTask.java:37)
	at org.apache.dubbo.registry.retry.AbstractRetryTask.run(AbstractRetryTask.java:129)
	at org.apache.dubbo.common.timer.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:653)
	at org.apache.dubbo.common.timer.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:732)
	at org.apache.dubbo.common.timer.HashedWheelTimer$Worker.run(HashedWheelTimer.java:454)
	at java.base/java.lang.Thread.run(Thread.java:833)

这个问题与 瓜子遇到的问题类似
这块代码好像没有在3.0的代码中 而是用了faultTolerant 这个参数
查看了源码 AbstractZookeeperClient 的 create()只有在 ZookeeperRegistry 调用 doRegister 设置为false。
提交日志 显示#11036 这个issue后修改的doRegisterd的faultTolerant 从true 改为了 false

@qijun4tian qijun4tian changed the title ZookeeperRegistry ->doRegister 方法 faultTolerant参数 设置为false 是不是会存在问题 ZookeeperRegistry ->doRegister 方法 faultTolerant参数 设置为false,是不是会存在问题 ? Jul 3, 2023
@qijun4tian
Copy link
Contributor Author

@AlbumenJ 是否存在问题,大佬帮忙看下啊

@qijun4tian qijun4tian mentioned this issue Jul 13, 2023
1 task
@AlbumenJ
Copy link
Member

可以帮提个 PR 把 faultTolerant 改成 false 嘛

@qijun4tian
Copy link
Contributor Author

可以帮提个 PR 把 faultTolerant 改成 false 嘛

我试试看

@iwangjie
Copy link

3.1.11 如何才能优雅的通过补丁解决此问题?

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

No branches or pull requests

3 participants