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
Why no :modify event in Linux adapter? #450
Comments
I've confirmed that, by monkey-patching Listen to add the |
Workaround until this issue is resolved: We've added the following snippet to our # BEGIN MONKEY PATCH OF LISTEN GEM
Listen::Adapter::Linux::DEFAULTS.tap do |defaults|
# Add :modify to the inotify events monitored by the Linux adapter
new_defaults = defaults.merge(events: defaults[:events] + [:modify])
Listen::Adapter::Linux.const_set(:DEFAULTS, new_defaults.freeze)
end
# END MONKEY PATCH OF LISTEN GEM |
Ah, here's a simpler version of the workaround: Listen::Adapter::Linux::DEFAULTS[:events] << :modify |
(Catching up here.) I'm happy to make a PR that adds |
@ColinDKelley thanks! I hadn't expected any response here after so much time passing. The Linux man page for inotify events: https://man7.org/linux/man-pages/man7/inotify.7.html
To flip the question: is there any reason why Listen would ever want to ignore |
@ms-ati I volunteered to be a listen maintainer a few months ago. I got the credentials last week, so now it's official. 😄 Thanks for the pointer to the docs! That does seem very clear. |
Awesome @ColinDKelley ! Major 👏 for taking this project maintenance on. One tests case it occurs to me that might be worth investigating is whether there is a duplicate events issue? Is it possible that on Linux but outside of Docker, edits to files were generating multiple events, and that's why it was working to ignore |
I guess that's possible, but I don't think it's likely. If anyone can run that same test on Linux outside of Docker, that would be great. |
Closing this out as it's included in v3.3.0.pre.3. |
BTW, I followed the git history back, and it turns out that I hope that the de-dup layer in |
In debugging why I no longer get any resonse from Listen when touching files in a Ubuntu docker container, I've discovered that
rb-inotify
sees a:modify
event, but this is NOT in the list of events that theListen::Adapter::Linux
listens to according to linux.rb#8 and linux.rb#87.What is the reasoning behind excluding the
:modify
event? And is this affecting anyone else, or is there something unique to my setup where I am only actually seeing those events generated?The text was updated successfully, but these errors were encountered: