-
Notifications
You must be signed in to change notification settings - Fork 39
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
On linux with python lib, when using mkdir -p, does not capture child folder creations #66
Comments
I'm pretty sure that we're not adding a mark on that first directory quickly enough to receive the second event. If there was an error watching new directories, we'd shoot a warning up and tell you. It looks like we just didn't notice. Ideally we should write the watcher in such a way that avoids the race altogether. |
We do notice destroy events on the nested path, though those events are tied to the first path, so not much of a surprise. $ ( wtr.watcher /tmp -ms 1000 | grep -v self | jq -c '. | {(.path_name): .effect_type}' ) & ( cd /tmp ; sleep 0.1 ; mkdir -p a/b ; rmdir a/b a )
{"/tmp/a":"create"}
{"/tmp/a/b":"destroy"}
{"/tmp/a":"destroy"} |
f4aaf62 should fix this. |
For fanotify, things get a bit weird. It "works", but: {"path_type":"dir","path_name":"/tmp/a","effect_type":"create","effect_time":1738444397609015400,"associated":null}
{"path_type":"dir","path_name":"/tmp/a/b","effect_type":"create","effect_time":1738444397609122077,"associated":null}
{"path_type":"dir","path_name":"/tmp/a (deleted)/b","effect_type":"destroy","effect_time":1738444397610121378,"associated":null}
{"path_type":"dir","path_name":"/tmp/a","effect_type":"destroy","effect_time":1738444397610169432,"associated":null} We get some weird |
Can't perfectly reproduce the behavior. I didn't write the kernel's fanotify implementation, but maybe if someone more versed in it could explain when that path is concatenated with extra metadata, and when it is not, that would be nice. Seems a bit weird. |
mkdir -p tfp/new
only one event got generated
{"effect_time":1738138437295141641,"path_name":".../test/tfp","associated_path_name":null,"effect_type":"create","path_type":"dir"}
This maybe a limit of underlying inotify ?
I am on 6.12.10-200.fc41.x86_64
The text was updated successfully, but these errors were encountered: