mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-12 12:33:02 +00:00
Fix uncaught exception in pre_spawn_start
This commit is contained in:
@@ -529,17 +529,19 @@ class User:
|
||||
|
||||
# trigger pre-spawn hook on authenticator
|
||||
authenticator = self.authenticator
|
||||
if authenticator:
|
||||
await maybe_future(authenticator.pre_spawn_start(self, spawner))
|
||||
|
||||
spawner._start_pending = True
|
||||
# update spawner start time, and activity for both spawner and user
|
||||
self.last_activity = (
|
||||
spawner.orm_spawner.started
|
||||
) = spawner.orm_spawner.last_activity = datetime.utcnow()
|
||||
db.commit()
|
||||
# wait for spawner.start to return
|
||||
try:
|
||||
if authenticator:
|
||||
# pre_spawn_start can thow errors that can lead to a redirect loop
|
||||
# if left uncaught (see https://github.com/jupyterhub/jupyterhub/issues/2683)
|
||||
await maybe_future(authenticator.pre_spawn_start(self, spawner))
|
||||
|
||||
spawner._start_pending = True
|
||||
# update spawner start time, and activity for both spawner and user
|
||||
self.last_activity = (
|
||||
spawner.orm_spawner.started
|
||||
) = spawner.orm_spawner.last_activity = datetime.utcnow()
|
||||
db.commit()
|
||||
# wait for spawner.start to return
|
||||
# run optional preparation work to bootstrap the notebook
|
||||
await maybe_future(spawner.run_pre_spawn_hook())
|
||||
if self.settings.get('internal_ssl'):
|
||||
|
Reference in New Issue
Block a user