You are viewing a plain text version of this content. The canonical link for it is here.
Posted to devnull@infra.apache.org by "356082462 (GitHub)" <gi...@apache.org> on 2018/08/23 18:50:51 UTC

[GitHub] [incubator-dubbo] 356082462 opened issue #2342: 多注册中心订阅服务,只要有一个注册中心不可以,应用就服务启动。

- [x] I have searched the [issues](https://github.com/apache/incubator-dubbo/issues) of this repository and believe that this is not a duplicate.
- [x] I have checked the [FAQ](https://github.com/apache/incubator-dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: 2.6.1

### 原因描述
在 AbstractZookeeperClient 中的 create 方法进行了递归,而子类 CuratorZookeeperClient 的 checkExists 方法吃掉了异常,导致应用启动的时候被卡住。该问题还是比较严重的,有个数据中心的注册中心不可以,有可能导致多个注册中心的应用失去重启的能力,以及不变更配置重新部署的能力。
AbstractZookeeperClient:
public void create(String path, boolean ephemeral) {
    if (!ephemeral) {
        //吃掉异常
        if (checkExists(path)) {
            return;
        }
    }
    int i = path.lastIndexOf('/');
    if (i > 0) {
        //递归
        create(path.substring(0, i), false);
    }
    if (ephemeral) {
        createEphemeral(path);
    } else {
        createPersistent(path);
    }
}
CuratorZookeeperClient:
public boolean checkExists(String path) {
    try {
        if (client.checkExists().forPath(path) != null) {
            return true;
        }
    } catch (Exception e) {
    }
    return false;
}



### Expected Result

What do you expected from the above steps?
按照默认的注册中心容错策略,在注册节点时,如果失败会进入定时重试逻辑。程序还会继续往下执行,不会卡住,应用能够成功启动。

### Actual Result

What is actually happen?
在注册节点时失败的异常被吃掉了,然后又递归了之前的逻辑,导致卡住,应用无法启动。

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2342 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org

[GitHub] [incubator-dubbo] ralf0131 closed issue #2342: 该Bug已经在2.6.2中解决

Posted by "ralf0131 (GitHub)" <gi...@apache.org>.
[ issue closed by ralf0131 ]

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2342 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org

[GitHub] [incubator-dubbo] ralf0131 commented on issue #2342: 该Bug已经在2.6.2中解决

Posted by "ralf0131 (GitHub)" <gi...@apache.org>.
Hi, I am closing this issue.

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2342 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org