-
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 reloader revamp #2805
pserve reloader revamp #2805
Conversation
This is ready for review. |
Is there a need to update the Pyramid docs? If so, is there a separate issue open? |
There's no change to the docs unless we want to add some mentions to the pserve docs like... To make this work better you should install watchdog into your development environment. See http://docs.pylonsproject.org/projects/hupper/en/latest/#watchdog-support for more info on what I mean. |
I made a new issue #2806 for making mention. |
New commits should handle #2806. |
Will review this in a little bit. |
0444cb7
to
df52b65
Compare
df52b65
to
d434735
Compare
I just rebased this branch on top of the latest master, should be mergeable again. |
Would it make sense to rebase and squash the first three commits down to "use hupper"? |
Sure if you want me to. In general Pyramid hasn't been very picky about commit history. |
I tend to not want to have WIP commits in the final history... but if it doesn't matter, I don't care. I've been using this branch + hupper + watchdog for the last 3 hours for a project I am working on. Haven't seen it crash yet!!! Also, it seems to be much faster at reloading than the old version. With watchdog it is fast enough that doing a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than possibly squashing the WIP I am a huge and excited +2 on this :D.
Is it restarting more than once per second? The behaviors are a little bit more complex than the old reloader because the file monitor is always running so some race conditions can definitely exist that I've tried to account for. |
d434735
to
067ce05
Compare
Okay I made the history pretty. |
It might be more than once per second (I have watchdog installed) but it's just really fast... I haven't seen it do something weird or get wedged. |
This PR replaces the
--reload
support inpserve
with the newhupper
package [1].Features
currently only on py35 but I'm working on it... the current pserve has lots of issues on windows, so it'sstillan improvement).hupper.get_reloader().trigger_reload()
. Kind of neat.SIGHUP
to the monitor process.watchdog
package [2] is installed then monitoring will be done using inotify instead of cpu-intensive polling.Incompatibilities
pyramid.scripts.pserve.watch_file
, andpyramid.scripts.pserve.add_file_callback
. support extending pserve to monitor arbitrary files via a custom ini section #2732 will be a path to a fully supported version of these features.hupper
also has its own public API to add files to monitor viahupper.get_reloader().watch_files(...)
.I want to avoid merging this until windows support is improved in hupper but we're close enough to get some review.[1] http://docs.pylonsproject.org/projects/hupper/en/latest/
[2] https://pypi.org/project/watchdog/