Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client calling out to private method in KernelManager #1047

Open
jgeraerts opened this issue Nov 20, 2024 · 0 comments
Open

client calling out to private method in KernelManager #1047

jgeraerts opened this issue Nov 20, 2024 · 0 comments

Comments

@jgeraerts
Copy link

_async_is_alive calls out to _async_is_alive in the kernelmanager.

https://github.com/jupyter/jupyter_client/blob/main/jupyter_client/client.py#L415

    async def _async_is_alive(self) -> bool:
        """Is the kernel process still running?"""
        from .manager import KernelManager

        if isinstance(self.parent, KernelManager):
            # This KernelClient was created by a KernelManager,
            # we can ask the parent KernelManager:
            return await self.parent._async_is_alive()
        if self._hb_channel is not None:
            # We don't have access to the KernelManager,
            # so we use the heartbeat.
            return self._hb_channel.is_beating()
        # no heartbeat and not local, we can't tell if it's running,
        # so naively return True
        return True

However when using the GatewayKernelManager from jupyter_server this assertion fails https://github.com/jupyter/jupyter_client/blob/main/jupyter_client/manager.py#L696, while it has overridden the is_alive method

So I think _async_is_alive should be made public and the GatewayKernelManager should also be adapted to override this method.

What are your thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant