mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-18 07:23:00 +00:00
Error if we hit pending spawn limit
The backlog actually doesn't help - almost all of them fail, and the exponential backoff just adds more work for our ticks
This commit is contained in:
@@ -369,15 +369,13 @@ class BaseHandler(RequestHandler):
|
|||||||
|
|
||||||
if self.settings['concurrent_spawn_limit'] is not None and \
|
if self.settings['concurrent_spawn_limit'] is not None and \
|
||||||
self.hub.pending_spawns > self.settings['concurrent_spawn_limit']:
|
self.hub.pending_spawns > self.settings['concurrent_spawn_limit']:
|
||||||
# This will throw an error if we hit our timeout
|
|
||||||
self.log.info(
|
self.log.info(
|
||||||
'More than %s pending spawns, throttling',
|
'More than %s pending spawns, throttling',
|
||||||
self.settings['concurrent_spawn_limit']
|
self.settings['concurrent_spawn_limit']
|
||||||
)
|
)
|
||||||
yield exponential_backoff(
|
raise web.HTTPError(
|
||||||
lambda: self.hub.pending_spawns < self.settings['concurrent_spawn_limit'],
|
429,
|
||||||
'Too many users are starting right now, try again later',
|
"Too many users are starting now, try again shortly")
|
||||||
)
|
|
||||||
|
|
||||||
self.hub.pending_spawns += 1
|
self.hub.pending_spawns += 1
|
||||||
tic = IOLoop.current().time()
|
tic = IOLoop.current().time()
|
||||||
|
Reference in New Issue
Block a user