-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
FileNotFoundError
during development
#207
Comments
Thanks for reporting, do the errors go away if your revert to v18.0? |
If my memory doesn't fail me, I was able to reproduce it yesterday with 0.15.0, and then I bumped it to 0.18.1. Assume that I can be mistaken. I've downgraded to try, but as I said, "[...] happens from time to time", so I can't easily reproduce. |
Okay, I see what's happening. This is not actually "file not found", it's that you're hitting the OS file watching limit. See the Error is Line 57 in 94ef903
Basically, the only time I've seen an error there was when the path didn't exist, so I created a I'm 99.9% sure this won't be related to the recent v0.18.1 release. So the next question is what should you do? Either watchfiles or your test suite is watching too many files, or your IDE and other apps are watching lots of files, then watchfiles is just going over the limit. If the problem is just that you're watching lots of files legitimately, you can increase If the problem is that watchfiles is somehow not "un-watching" fies when the watcher is dropped, we'll need to make a change in watchfiles. I'll do some investigation. |
Thanks. |
Okay, I've fixed the wrong-error issue in #208. I've also done some digging into how many files watchfiles is watching, using inotify-info. I ran the following script, then monitored the number of "watches" from the "python3.10" process using import watchfiles
print(f'Watchfiles v{watchfiles.__version__}')
for i in range(100):
for changes in watchfiles.watch('/home/samuel/code/pydantic/', rust_timeout=1, yield_on_timeout=True):
print(i, changes)
break I don't see the number of watches increase, also there are I think the problem is probably with either a test which watches a big directory, or your system is close to the watch limit. Maybe you could have a quick look with |
* better error on OS watcher limit, #207 * skip message check on other OSes * fix linting * more error details, skip build on PR * fix docs build, support rust 1.56 * file not found on force polling * fix error typo
Am I supposed to use |
I just ran it and it showed which processes where holding the most watches. |
Hi, I've been seeing a similar issue where I suspect the root cause is not a missing file/folder. I was wondering if it would be possible to cut a new release which includes the fix |
I think your link is broken and you mean #208. I'll try to make a new release soon. |
done, building now, with luck should be released in a ~30mins. |
Hahah yes, oops.
Thank you so very much! |
Description
Hi Samuel 👋
I'm having a bad experience when developing on
uvicorn
, and I'd really appreciate some help. 🙏Since a couple of days ago I've been facing a lot of
FileNotFoundError
, which happens from time to time.Would you perhaps be able to help me here?
Full Pytest Trace
Example Code
No response
Watchfiles Output
No response
Operating System & Architecture
Linux-5.15.0-52-generic-x86_64-with-glibc2.31
#58~20.04.1-Ubuntu SMP Thu Oct 13 13:09:46 UTC 2022
Environment
No response
Python & Watchfiles Version
python: 3.10.5 (main, Jul 9 2022, 13:39:02) [GCC 9.4.0], watchfiles: 0.18.1
Rust & Cargo Version
No response
The text was updated successfully, but these errors were encountered: