-
Notifications
You must be signed in to change notification settings - Fork 54
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
Use poll-based approach to subscribe to file changes #463
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fatanugraha The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
ca5d9ab
to
e6ba620
Compare
2a2c889
to
0963cb5
Compare
the new test is passing on darwin but not on linux. In linux, inotify won't detect changes of the link destination inside the monitored directory. maybe fixing the actual bug in upstream is easier than working around it 😂 |
Or we can do both, have a fix upstream, but have a workaround until the fix is merged. |
2af050d
to
95da137
Compare
Yeah, i can't think of any easy workaround for the fsnotify bug so i'm just going to use poll-based approach to subscribe to the change event. was considering to just have a for loop + os.Read for simplicity but i guess the current approach might be way cheaper when the file that we watched rarely changed (which i think is the case for us). |
fsnotify/fsnotify can't watch a folder that contains a symlink into a socket or named pipe. Use poll-based mechanism to watch the file for the time being until we find a better way or fix the issue in the upstream. Signed-off-by: Fata Nugraha <[email protected]>
I'm not entirely sure whether this is an acceptable workaround to the issue or not, but I don't see other way for us to use the latest version without fixing the bug in upstream.
Fixes #462