Skip to content
This repository has been archived by the owner on Jan 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #35 from lsst-sqre/tickets/DM-39400
Browse files Browse the repository at this point in the history
DM-39400: Improve logging in spawner get_url method
  • Loading branch information
rra authored May 25, 2023
2 parents 32ba4ca + ca4fda0 commit 9a07369
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/rsp_restspawner/spawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,21 @@ async def get_url(self) -> str:
"""
try:
return await self._get_internal_url()
except MissingFieldError:
# This is normal if the lab is currently being spawned or deleted
# when JupyterHub asks for its URL. Tell JupyterHub to use the
# stored URL.
msg = (
f"Lab for {self.user.name} has no URL (possibly still"
" spawning), falling back on stored URL"
)
self.log.info(msg)
return await super().get_url()
except Exception:
msg = f"Unable to get URL of running lab for {self.user.name}"
msg = (
f"Unable to get URL of running lab for {self.user.name},"
" falling back on stored URL"
)
self.log.exception(msg)
return await super().get_url()

Expand Down

0 comments on commit 9a07369

Please sign in to comment.