-
Notifications
You must be signed in to change notification settings - Fork 34
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
Duplicate events when editing file on Samba share #92
Comments
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. |
You can see example here: openhab/openhab-core#3400 (comment) (except the last post from myself, that is a bug in our code). |
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. |
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. |
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.
Versus saving it locally using e.g. nano.
|
I am also getting 8 events on one event type . Like a file is deleted then 8 events are fired for it |
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. |
We have found that sometimes editing files that are exposed on a samba share results in multiple create/delete events (up to six events in about half a second) instead of a single modify event.
We have now implemented a workaround in our code (openhab/openhab-core#3404) but it would be great if this could be handled here as I believe it'll be encountered by a larger audience.
The text was updated successfully, but these errors were encountered: