From 8a31ea3e042b7986f5dbd3321b9fc688261f0e34 Mon Sep 17 00:00:00 2001 From: Darshan808 Date: Thu, 13 Feb 2025 15:39:39 +0545 Subject: [PATCH] docs: add note that startup banner displays before async tasks begin --- docs/source/developers/extensions.rst | 9 +++++++++ jupyter_server/serverapp.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/source/developers/extensions.rst b/docs/source/developers/extensions.rst index 7d1f24e431..e88acfb0f6 100644 --- a/docs/source/developers/extensions.rst +++ b/docs/source/developers/extensions.rst @@ -87,6 +87,10 @@ Here is basic example: """ await asyncio.sleep(.1) +.. note:: The server startup banner (displaying server info and access URLs) is printed before starting asynchronous tasks, so those tasks might still be running even after the banner appears. + +.. WARNING: This note is also present in the "Starting asynchronous tasks from an ExtensionApp" section. + If you update it here, please update it there as well. Making an extension discoverable -------------------------------- @@ -386,6 +390,11 @@ Here is a basic (pseudo) code example: async def stop_extension(self): self.my_background_task.cancel() +.. note:: The server startup banner (displaying server info and access URLs) is printed before starting asynchronous tasks, so those tasks might still be running even after the banner appears. + +.. WARNING: This note is also present in the "Starting asynchronous tasks from an extension" section. + If you update it here, please update it there as well. + Distributing a server extension =============================== diff --git a/jupyter_server/serverapp.py b/jupyter_server/serverapp.py index 036fcd3044..01489e3dc5 100644 --- a/jupyter_server/serverapp.py +++ b/jupyter_server/serverapp.py @@ -3125,7 +3125,7 @@ def start_app(self) -> None: " %s" % self.display_url, ] - self.log.critical("\nDP_DAI2\n" + "\n".join(message)) + self.log.critical("\n".join(message)) async def _cleanup(self) -> None: """General cleanup of files, extensions and kernels created