diff --git a/jupyter_server/services/kernels/kernelmanager.py b/jupyter_server/services/kernels/kernelmanager.py index 7e9bfdd8e5..e455483d52 100644 --- a/jupyter_server/services/kernels/kernelmanager.py +++ b/jupyter_server/services/kernels/kernelmanager.py @@ -210,7 +210,9 @@ async def start_kernel(self, kernel_id=None, path=None, **kwargs): kwargs["kernel_id"] = kernel_id kernel_id = await ensure_async(self.pinned_superclass.start_kernel(self, **kwargs)) self._kernel_connections[kernel_id] = 0 - asyncio.ensure_future(self._finish_kernel_start(kernel_id)) + fut = asyncio.ensure_future(self._finish_kernel_start(kernel_id)) + if not getattr(self, "use_pending_kernels", None): + await fut # add busy/activity markers: kernel = self.get_kernel(kernel_id) kernel.execution_state = "starting"