-
Notifications
You must be signed in to change notification settings - Fork 4
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
RSS_FUNNEL_WATCH=true is unreliable #80
Comments
That is weird. I attempted to reproduce it without success. I tried adding and removing endpoints, each of the change is successfully picked up by the file system watcher and the ui after pressing the "Reload Config" button. I'm suspecting maybe it's the inotify event are not passing through docker mount boundary. On my development environment I run the binary directly without docker, and in my docker deployed node I don't use the watch feature. Can you give me your |
This minimal
|
I decided to test the non-docker, linux x86 released version from here: https://github.com/shouya/rss-funnel/releases/tag/0.1.0 I started
It started successfully and I loaded the inspector UI successfully. Then I removed an endpoint from
I then reloaded the inspector UI, and the deleted endpoint was removed from the inspector. However, I then restored the deleted endpoint to |
Unfortunately, I was unable to reproduce the issue with either docker-compose or the downloaded binary ( I noticed a potential issue in your docker-compose.yml file. The line I tried running both the debug and release builds on the master branch and the My current best guess is that the issue may be related to the difference between our operating systems. Could you please let me know which operating system you're running (both the host and the os the docker-machine runs on)? For reference, I'm using Debian Linux. |
I am also using debian linux:
The issue seems to be with vim and how its method for saving files interacts with inotify on linux. The specific option in question is backupcopy. Its default value is 'auto' on unix when not in vi-compatible mode. This gives vim the permission to rename the original file to a backup file and then write the edited contents as a new file with the original name. This behavior leads to inotify monitoring the backup file instead of the original file. To avoid breaking the inotify monitor, I diagnosed this by running There's some discussion of using inotify to monitor the parent directory of the target file. Then inotify would fire events for renames within that directory. This would come at the cost of using more resources. The max number of inotify watches is limited by system configuration. This is all just for your information. Feel free to close this issue if you think it's out of scope for rss-funnel. |
Thanks for that valuable info, it makes total sense. If the issue is really caused by Vim's |
Further testing with I tested running When testing the above, I used this script to query the number of inotify watches that are in use and it reports only 1 for the |
As reported in #80, the fs watcher previously cannot detect config changes made using vim. Vim's default save file behavior (controlled by `backupcopy` option) is to save the file under a new name and then rename it to override the original file. As such, the inode of the previously watched file is gone and will no longer triggers inotify events. This PR addresses the issue by additionally detecting file remove events, and re-launch the watcher on the same path when the file is found deleted. In case the config file is truly deleted instead of being overridden, the watcher will wait indefinitely until the file has been recreated. Fixes #80.
@shouya I tested release 0.1.2 this morning. The binary release has indeed fixed the issue with vim. Unfortunately, the docker image is not working. It's displaying the same behavior in the initial bug report. I've not tested this theory at all, but I have a suspicion vim's I've added an entry to the FAQ that explains the issue and suggests a minimal workaround. |
Thank you for updating the doc. The reload is not supposed to work with Docker. On file save, the bind mounted file is simply removed from Docker's point of view. Although I didn't confirm this, but I don't think Docker is going to rebind the file under the same name. So the program is just unable to see the new file inside Docker. |
I'm running
rss_funnel
via a docker compose file with theRSS_FUNNEL_WATCH: true
inside theenvironment:
block.I startup
rss_funnel
with a validfunnel.yaml
file and appropriateRSS_FUNNEL_CONFIG
environment setting. The logs report:Then I edit my
funnel.yaml
to completely remove one of the endpoints. The logs then report:After that I go to my browser, reload the inspector page and also click the "Reload Config" button. I would expect the endpoint I just deleted to be absent from the inspector UI, but it is still present.
I can mostly get the logs to report a successful reload if I change a config from invalid to valid. However even then it doesn't appear to always work. (Sorry I don't have more concrete reproduction steps).
The text was updated successfully, but these errors were encountered: