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

Unexpected notice for zk data change #334

Open
24kpure opened this issue Aug 30, 2024 · 7 comments · May be fixed by #337
Open

Unexpected notice for zk data change #334

24kpure opened this issue Aug 30, 2024 · 7 comments · May be fixed by #337

Comments

@24kpure
Copy link
Author

24kpure commented Aug 30, 2024

Though data has bean created or modified for a long time before application start ,curator still publish a event about node create.Ignoring event whose modify time is out of date may be a good way.

   public void childEvent(CuratorFramework client, TreeCacheEvent event)
           throws Exception {
      TreeCacheEvent.Type eventType = event.getType();
       if (eventType != NODE_ADDED && eventType != NODE_REMOVED
               && eventType != NODE_UPDATED) {
           return;
       }

       // ignore event whose modify time is out of date
       String path = event.getData().getPath();
       long validTime = System.currentTimeMillis() - TimeUnit.MINUTES.toMillis(1);
       if (eventType == NODE_ADDED
               && event.getData().getStat().getMtime() < validTime) {
           return;
       }

       this.publisher.publishEvent(new RefreshEvent(this, event, getEventDesc(event)));
}

@24kpure
Copy link
Author

24kpure commented Sep 19, 2024

@spencergibb
Copy link
Member

Obviously, we don't control notifications from curator. What problem is this causing?

@spring-cloud-issues
Copy link

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@24kpure
Copy link
Author

24kpure commented Oct 16, 2024

Obviously, we don't control notifications from curator. What problem is this causing?

It's not nessary to listen data which has bean created or modified for a long time before application start.

@spencergibb
Copy link
Member

PRs welcome

@24kpure
Copy link
Author

24kpure commented Nov 13, 2024

fix in #337

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants