You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
node-inotify needs to use another way to save the callbacks other than the watch file descriptor as key. When you make a removeWatch and a subsequent addWatch, inotify is using the same watch descriptor which is problematic because when the last event of the removed watch arrive, the callback deleted belongs to the new addWatch which is completely wrong !
The text was updated successfully, but these errors were encountered:
This is a segfault issue, with a simple fix. (I worked around it by making sure to add before removing.)
The easy fix: in AddWatch(), before calling
inotify->handle_->Set(descriptor, args_->Get(callback_sym));
throw an error if the descriptor already has a value.
Ok, I will do this as a work around. The best solution is using a hash (sha1?) as object key instead of the watch file descriptor. We can use maybe the crypto module that comes with NodeJS and use as key the Watch File Descriptor for the module to generate the hash.
node-inotify needs to use another way to save the callbacks other than the watch file descriptor as key. When you make a removeWatch and a subsequent addWatch, inotify is using the same watch descriptor which is problematic because when the last event of the removed watch arrive, the callback deleted belongs to the new addWatch which is completely wrong !
The text was updated successfully, but these errors were encountered: