Skip to content
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

Merged
merged 2 commits into from Oct 27, 2016

Conversation

minrk
Copy link
Member

@minrk minrk commented Oct 21, 2016

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

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.
Copy link
Contributor

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:
Copy link
Contributor

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.
Copy link
Contributor

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?).

Copy link
Contributor

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 ;-)

@willingc willingc merged commit 5163c7a into jupyterhub:master Oct 27, 2016
@willingc
Copy link
Contributor

willingc commented Oct 27, 2016

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.

@yuvipanda
Copy link
Contributor

I worked around this problem in kubernetes spawner, but I think systemd
spawner might still need this. Will respond here if I find any more issues
around this :) Thanks for the patch + merge!

On Thu, Oct 27, 2016 at 8:34 AM, Carol Willing notifications@github.com
wrote:

Thanks @minrk https://github.com/minrk. Changes look great. I'm going
to go ahead and merge. We can always iterate if @yuvipanda
https://github.com/yuvipanda's report or community uncovers anything.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#824 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAB23qOmTX0OiAT4jgw5p5ckIDpFNdwRks5q4MRqgaJpZM4KdSbo
.

Yuvi Panda T
http://yuvi.in/blog

@minrk minrk modified the milestone: 0.7 Nov 11, 2016
@minrk minrk deleted the allow-empty-state branch February 23, 2018 12:01
chicocvenancio pushed a commit to chicocvenancio/jupyterhub that referenced this pull request May 6, 2018
Don't assume empty state means not running
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Surprising behavior when no state is kept in spawner
3 participants