Skip to content

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

@qijun4tian

Description

@qijun4tian
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions