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

ZookeeperPropertySourceLocator not synchronized with ConfigWatcher #289

Open
forchid opened this issue Jun 12, 2021 · 0 comments
Open

ZookeeperPropertySourceLocator not synchronized with ConfigWatcher #289

forchid opened this issue Jun 12, 2021 · 0 comments

Comments

@forchid
Copy link

forchid commented Jun 12, 2021

Describe the bug
Locating propertySources in ZookeeperPropertySourceLocator by directly accessing zookeeper instead of ConfigWatcher and its' TreeCaches can lead to several serious problems.

  1. Zookeeper new changes lost when ZookeeperPropertySourceLocator locating.
  2. Curator framework TreeCache events in ConfigWatcher lost before publishing ApplicationReadyEvent.
  3. Curator framework TreeCache NODE_ADDED events(normal TreeCache filling) interfere with the whole application after spring boot publishing ApplicationReadyEvent. Actually during curator framework TreeCache filling, the TreeCache NODE_ADDED events shoudn't cause RefreshEvent before TreeCache INITIALIZED event.
  4. TreeCache NODE_ADDED events(normal TreeCache filling) seriously interfere with the application from TreeCache event CONNECTION_LOST to CONNECTION_RECONNECTED.

This issue exists in spring-cloud-zookeeper 2.2.+, 3.+.

Sample
This issue is obvious by restarting spring boot application about ten times.
eg.

public class App {
  public static void main(String[] args) throw Exception {
    ConfigurableApplicationContext ctx;
    while(true) {
      ctx = SpringApplication.run(App.class, args);
      Thread.sleep(20000);
      ctx.close();
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants