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
Don't assume empty state means not running #824
Conversation
Some Spawners may not need state, and they should be allowed to resume on Hub restart as well. Adds some detail about when .poll may be called and how it should behave in less obvious circumstances
@@ -351,6 +351,20 @@ def poll(self): | |||
"""Check if the single-user process is running | |||
|
|||
return None if it is, an exit status (0 if unknown) if it is not. |
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.
returns:
None, if single-user process is running.
Exit status (0 if unknown), if it is not running.
State transitions, behavior, and return response:
If the Spawner has not finished starting, | ||
it should behave as if it is running (status=None). | ||
|
||
Assumptions about poll and when it can be called: |
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.
Design assumptions about when `poll` may be called:
|
||
Assumptions about poll and when it can be called: | ||
|
||
- poll may be called before start when state is loaded on Hub restart. |
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.
- On Hub restart: 'poll' may be called before 'start' when state is loaded on Hub restart.
'poll' should return exit status 0 (unknown) if the Spawner has not been
initialized via 'load_state' or 'start'.
- If `.start()` is async: 'poll' may be called during any yielded portions of the 'start' process.
'poll' should return None when 'start' is yielded, indicating that the
'start' process has not yet exited (completed?).
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.
Spacing is a bit wonky above, but you get the gist ;-)
Thanks @minrk. Changes look great. I'm going to go ahead and merge. We can always iterate if @yuvipanda's report or community uncover anything. |
I worked around this problem in kubernetes spawner, but I think systemd On Thu, Oct 27, 2016 at 8:34 AM, Carol Willing notifications@github.com
Yuvi Panda T |
Don't assume empty state means not running
Some Spawners may not need state, and they should be allowed to resume on Hub restart as well.
Adds some detail about when .poll may be called and how it should behave in less obvious circumstances.
closes #819
cc @willingc for docs, @yuvipanda for report