Skip to content

Commit 5fd24d0

Browse files
committed
Count process as ready if it can respond
Our 'readyness' condition check is to make sure we can show something to the user - it doesn't matter if it is a non-200 response. Primarily, we were getting 404s and other responses that were causing issues here - 3xxs were resolved by aiohttp.
1 parent 8fae7dd commit 5fd24d0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
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

0 commit comments

Comments
 (0)