Use poll-based approach to subscribe to file changes#463
Use poll-based approach to subscribe to file changes#463openshift-merge-bot[bot] merged 1 commit intocontainers:mainfrom
Conversation
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 <fatanugraha@outlook.com>
lstocchi
left a comment
There was a problem hiding this comment.
LGTM, tested and works fine
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cfergeau, evidolob, fatanugraha, lstocchi The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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