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

jupyterhub/user.py deletes the pod even if delete_stopped_pods is set to False. #462

Open
rainwoodman opened this issue Dec 8, 2020 · 0 comments

Comments

@rainwoodman
Copy link

jupyterhub/user.py deletes the pod even if delete_stopped_pods is set to False.

The flag is only checked in before a 'graceful' stop, here:

if self.delete_stopped_pods:

However, if the container fails to start at the very beginning, then user.py will issue a call to spawner.stop, and the pod is deleted. This hinders the debugging of the early stage setup issues of the single user container image.

I do not know if we can move the check to stop, because we also use stop to stop the existing pod (see the stacktrace below) I think this will work as expected if we rename the unconditional stop to _stop, and add a check on delete_stopped_pods in stop for interfacing with user.py. However, I am not so confident about my async programming skills to prepare a PR. :)

The stack trace leading to the deletion from user.py on early failure:

  File "/usr/local/bin/jupyterhub", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/jupyterhub/app.py", line 2854, in launch_instance
    loop.start()
  File "/usr/local/lib/python3.8/dist-packages/tornado/platform/asyncio.py", line 199, in start
    self.asyncio_loop.run_forever()
  File "/usr/lib/python3.8/asyncio/base_events.py", line 570, in run_forever
    self._run_once()
  File "/usr/lib/python3.8/asyncio/base_events.py", line 1859, in _run_once
    handle._run()
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.8/dist-packages/jupyterhub/handlers/base.py", line 900, in finish_user_spawn
    await spawn_future
  File "/usr/local/lib/python3.8/dist-packages/jupyterhub/user.py", line 720, in spawn
    await self._wait_up(spawner)
  File "/usr/local/lib/python3.8/dist-packages/jupyterhub/user.py", line 758, in _wait_up
    await self.stop(spawner.name)
  File "/usr/local/lib/python3.8/dist-packages/jupyterhub/user.py", line 797, in stop
    await spawner.stop()
  File "/usr/local/lib/python3.8/dist-packages/kubespawner/spawner.py", line 1980, in stop
    traceback.print_stack()
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

No branches or pull requests

1 participant