Skip to content

Commit 6eea2b7

Browse files
authored
Merge pull request #91 from yuvipanda/no-200
Count process as ready if it can respond
2 parents 580476c + 053603a commit 6eea2b7

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

docs/server-process.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ pairs.
4141

4242
Timeout in seconds for the process to become ready, default ``5s``.
4343

44+
A process is considered 'ready' when it can return a valid HTTP response on the
45+
port it is supposed to start at.
46+
4447
#. **environment**
4548

4649
One of:

jupyter_server_proxy/handlers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,10 @@ async def _http_ready_func(self, p):
298298
async with aiohttp.ClientSession() as session:
299299
try:
300300
async with session.get(url) as resp:
301+
# We only care if we get back *any* response, not just 200
302+
# If there's an error response, that can be shown directly to the user
301303
self.log.debug('Got code {} back from {}'.format(resp.status, url))
302-
return resp.status == 200
304+
return True
303305
except aiohttp.ClientConnectionError:
304306
self.log.debug('Connection to {} refused'.format(url))
305307
return False

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
setuptools.setup(
55
name="jupyter-server-proxy",
6-
version='1.0beta7',
6+
version='1.0beta8',
77
url="https://github.com/jupyterhub/jupyter-server-proxy",
88
author="Ryan Lovett & Yuvi Panda",
99
author_email="rylo@berkeley.edu",

0 commit comments

Comments
 (0)