Code Monkey home page Code Monkey logo

Comments (7)

gmethvin avatar gmethvin commented on August 15, 2024

Are there specific types of edits that cause that behavior? Did you check if it's the underlying Java watch service that's duplicating the events or if they're generated by directory-watcher itself? (you should be able to see with debug logging enabled)

Depending on how the events are generated, we can probably detect that sequence of events in directory-watcher and compress them into a single MODIFY.

from directory-watcher.

J-N-K avatar J-N-K commented on August 15, 2024

You can see example here: openhab/openhab-core#3400 (comment) (except the last post from myself, that is a bug in our code).

from directory-watcher.

gmethvin avatar gmethvin commented on August 15, 2024

Which platforms have you tested on? Seems like it's either due to a bug in the underlying WatchService implementation or the events the OS itself is reporting.

from directory-watcher.

J-N-K avatar J-N-K commented on August 15, 2024

For @mhilbush it is Ubuntu 22.04 for the samba server and a MacOS client. I'm not sure who actually is the issue here, if it's a faulty behavior of the client or the server.

from directory-watcher.

mhilbush avatar mhilbush commented on August 15, 2024

I also see similar behavior using a Windows client (e.g. Notepad++ on Win 10) and a Linux client (nano on Ubuntu) accessing the same share as with the MacOS client.

2023-02-28 07:18:03.876 [DEBUG] [io.methvin.watcher.DirectoryWatcher ] - ENTRY_MODIFY [/opt/openhab4/conf/rules/zoneminder.rules]
2023-02-28 07:18:03.877 [DEBUG] [io.methvin.watcher.DirectoryWatcher ] - -> MODIFY [/opt/openhab4/conf/rules/zoneminder.rules] (isDirectory: false)
2023-02-28 07:18:03.877 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'zoneminder.rules'
2023-02-28 07:18:03.923 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'zoneminder.rules' is either empty or cannot be parsed correctly!
2023-02-28 07:18:03.923 [DEBUG] [io.methvin.watcher.DirectoryWatcher ] - ENTRY_MODIFY [/opt/openhab4/conf/rules/zoneminder.rules]
2023-02-28 07:18:03.924 [DEBUG] [io.methvin.watcher.DirectoryWatcher ] - -> MODIFY [/opt/openhab4/conf/rules/zoneminder.rules] (isDirectory: false)
2023-02-28 07:18:03.924 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'zoneminder.rules'

Versus saving it locally using e.g. nano.

[2023-02-28 07:39:28.275 [DEBUG] [io.methvin.watcher.DirectoryWatcher ] - ENTRY_MODIFY [/opt/openhab4/conf/rules/zoneminder.rules]
2023-02-28 07:39:28.276 [DEBUG] [io.methvin.watcher.DirectoryWatcher ] - -> MODIFY [/opt/openhab4/conf/rules/zoneminder.rules] (isDirectory: false)
2023-02-28 07:39:28.277 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'zoneminder.rules'
2023-02-28 07:39:29.909 [DEBUG] [io.methvin.watcher.DirectoryWatcher ] - ENTRY_MODIFY [/opt/openhab4/conf/rules/zoneminder.rules]

from directory-watcher.

priyankadhiman0803 avatar priyankadhiman0803 commented on August 15, 2024

I am also getting 8 events on one event type . Like a file is deleted then 8 events are fired for it

from directory-watcher.

gmethvin avatar gmethvin commented on August 15, 2024

I likely won't have time to look into this further anytime soon, but I'm happy to accept pull requests if anyone finds a viable way to handle this.

from directory-watcher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.