mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-10 03:23:04 +00:00
render pending page if triggered spawn doesn't finish
instead of redirecting, which starts redirect loop counter
This commit is contained in:
@@ -708,6 +708,15 @@ class UserSpawnHandler(BaseHandler):
|
|||||||
else:
|
else:
|
||||||
yield self.spawn_single_user(current_user)
|
yield self.spawn_single_user(current_user)
|
||||||
|
|
||||||
|
# spawn didn't finish, show pending page
|
||||||
|
if spawner.pending:
|
||||||
|
self.log.info("%s is pending %s", spawner._log_name, spawner.pending)
|
||||||
|
# spawn has started, but not finished
|
||||||
|
self.statsd.incr('redirects.user_spawn_pending', 1)
|
||||||
|
html = self.render_template("spawn_pending.html", user=current_user)
|
||||||
|
self.finish(html)
|
||||||
|
return
|
||||||
|
|
||||||
# We do exponential backoff here - since otherwise we can get stuck in a redirect loop!
|
# We do exponential backoff here - since otherwise we can get stuck in a redirect loop!
|
||||||
# This is important in many distributed proxy implementations - those are often eventually
|
# This is important in many distributed proxy implementations - those are often eventually
|
||||||
# consistent and can take upto a couple of seconds to actually apply throughout the cluster.
|
# consistent and can take upto a couple of seconds to actually apply throughout the cluster.
|
||||||
|
Reference in New Issue
Block a user