Skip to content

Commit 547aa0c

Browse files
lexmingconsideRatio
authored andcommitted
poll job status while waiting for single-user server to be reachable
1 parent f7de5ad commit 547aa0c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

batchspawner/batchspawner.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,13 @@ async def start(self):
448448
# don't actually run the single-user server yet.
449449
if hasattr(self, "mock_port"):
450450
self.port = self.mock_port
451+
# Check if job is still running
452+
status = await self.poll()
453+
if status:
454+
raise RuntimeError(
455+
"The Jupyter batch job started"
456+
" but died before launching the single-user server."
457+
)
451458

452459
self.db.commit()
453460
self.log.info(

0 commit comments

Comments
 (0)