dubbo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xia-fei (GitHub) <git...@apache.org>
Subject [GitHub] [incubator-dubbo] xia-fei commented on issue #3700: win10下 meta-report缓存文件保存出错
Date Tue, 09 Apr 2019 08:12:29 GMT
```
 private void saveProperties(URL url) {
        if (file == null) {
            return;
        }

        try {
            StringBuilder buf = new StringBuilder();
            Map<String, List<URL>> categoryNotified = notified.get(url);
            if (categoryNotified != null) {
                for (List<URL> us : categoryNotified.values()) {
                    for (URL u : us) {
                        if (buf.length() > 0) {
                            buf.append(URL_SEPARATOR);
                        }
                        buf.append(u.toFullString());
                    }
                }
            }
            properties.setProperty(url.getServiceKey(), buf.toString());
            long version = lastCacheChanged.incrementAndGet();
            if (syncSaveFile) {
                doSaveProperties(version);
            } else {
                registryCacheExecutor.execute(new SaveProperties(version));
            }
        } catch (Throwable t) {
            logger.warn(t.getMessage(), t);
        }
    }
```

```
  private class SaveProperties implements Runnable {
        private long version;

        private SaveProperties(long version) {
            this.version = version;
        }

        @Override
        public void run() {
            doSaveProperties(version);
        }
    }
```

如果创建文件失败,就死循环递归了。不知道为什么catch还要再执行。

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3700 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
Mime
View raw message