-
Notifications
You must be signed in to change notification settings - Fork 886
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
pserve --reload in 1.6 is less reliable than in 1.5 #2223
Comments
@hyperknot not all files cause the server to restart. For details see http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/project.html#reloading-code Provide a link to your project repository, and identify which files do not cause the server to restart and which you think it should do so. |
@stevepiercy I understand that, however it is not the case here:
|
The new reloader won't reload a file after it has had an error unless the file has changed on disk. If you notice the error, change it and save while it is still checking the rest of the files, you may cause a race condition whereby the reloader won't notice your file has changed because it was still busy checking the other files (this is strictly theoretical based upon what I remember from reading the code, I have not verified that this is the case). We may need to do additional verification that the file hasn't changed while the reloader is active. |
Does it pick up the file again if you re-save it (with no syntax errors of course)? |
One thing which was definitely missing in my case was the warning message, which should be displayed normally (based on the source code). It might be timing related or because my error was inside a try-except block (just an idea). I saved the file at about 3x times afterwards I fixed it, but it didn't pick it up. |
From the description (it used to reload under pyramid < 1.6), I'm assuming that the |
When I was implementing this feature you can see in #2049 that I ran across a different (but maybe similar timing-related issue) where the reloader got into a loop, thinking that the file had been modified during every poll interval. I haven't been able to reproduce either that issue or this one with the final version of the code though. |
@tseaver It was happening at runtime, like:
@mmerickel I've just run into a much simpler case, reload was not detecting any change in I'm on OS X 10.9.5, Python 2.7.11. |
related #2250 |
Somehow in 1.6 the
pserve --reload
is not as reliable as it used to be in pre-1.6.Bug:
Pserve can get into a mode, where it forgets about files, and no matter if the file has been saved and resaved, it just doesn't want to reload it. I cannot reproduce it yet, but it happened after I had a NameError in a try-except block. Pserve didn't give any warning in that case, it just 'forgot' about that particular file's updates. It's also possible that one of the savings of the file was during a reload process or something timing related.
I had to manually stop the process with Ctrl + C and start it again, to get pserve back into normal mode.
The text was updated successfully, but these errors were encountered: