-
Notifications
You must be signed in to change notification settings - Fork 128
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
Recursive watches do not work on OpenBSD #172
Comments
Actually, recursive watches do work, but it seems it takes some time for the "recursiveness" part to kick in?
|
|
@AudriusButkevicius Thanks for the detailed report! I think this happens because Is this a case, @pblaszczyk? |
Random theory. Event delivery from the kernel blocks the kernel from delivering further events. That is, the thread that receives the event from the kernel should register a watch for subfolder upon receiving the event and before returning (control to the kernel). Is subfolder registration happening in a separate go routine outside of the kqueue loop which would support the theroy? |
@AudriusButkevicius Everything happens async, outside kqueue loop with https://github.com/rjeczalik/notify/blob/master/watcher_kqueue.go#L133. At least I'm not aware of anything blocking as you described. |
Yeah after having read the kqueue manual, it seems impossible to subscribe recursively, however, I think the following might be a sensible approach? If I am watching directory X, and subdirectory Y gets created, I should setup a watch for Y, walk Y and dispatch a created event for everything inside Y (potentially deduplicating as events from kqueue arrive later (or let it have duplicates, who cares)) |
@AudriusButkevicius This would be viable solution, we already maintain an in-memory tree of watches (directories), so maybe it would be even possible to not send duplicates. |
On OpenBSD:
On Windows:
Yet removals work fine (even tho out of order and not sure perhaps the walk and unlink is done by rm?)
On Windows:
ktrace does seem to report recursive events however:
ktrace output
OpenBSD 6.4
The text was updated successfully, but these errors were encountered: