mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-18 15:33:02 +00:00
Merge pull request #2750 from minrk/check-routes-first
wait for proxy before accepting requests
This commit is contained in:
@@ -2452,6 +2452,20 @@ class JupyterHub(Application):
|
|||||||
loop.stop()
|
loop.stop()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# start the proxy
|
||||||
|
if self.proxy.should_start:
|
||||||
|
try:
|
||||||
|
await self.proxy.start()
|
||||||
|
except Exception as e:
|
||||||
|
self.log.critical("Failed to start proxy", exc_info=True)
|
||||||
|
self.exit(1)
|
||||||
|
else:
|
||||||
|
self.log.info("Not starting proxy")
|
||||||
|
|
||||||
|
# verify that we can talk to the proxy before listening.
|
||||||
|
# avoids delayed failure if we can't talk to the proxy
|
||||||
|
await self.proxy.get_all_routes()
|
||||||
|
|
||||||
ssl_context = make_ssl_context(
|
ssl_context = make_ssl_context(
|
||||||
self.internal_ssl_key,
|
self.internal_ssl_key,
|
||||||
self.internal_ssl_cert,
|
self.internal_ssl_cert,
|
||||||
@@ -2489,16 +2503,6 @@ class JupyterHub(Application):
|
|||||||
self.log.error("Failed to bind hub to %s", self.hub.bind_url)
|
self.log.error("Failed to bind hub to %s", self.hub.bind_url)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
# start the proxy
|
|
||||||
if self.proxy.should_start:
|
|
||||||
try:
|
|
||||||
await self.proxy.start()
|
|
||||||
except Exception as e:
|
|
||||||
self.log.critical("Failed to start proxy", exc_info=True)
|
|
||||||
self.exit(1)
|
|
||||||
else:
|
|
||||||
self.log.info("Not starting proxy")
|
|
||||||
|
|
||||||
# start the service(s)
|
# start the service(s)
|
||||||
for service_name, service in self._service_map.items():
|
for service_name, service in self._service_map.items():
|
||||||
msg = (
|
msg = (
|
||||||
|
Reference in New Issue
Block a user