jupyter_client icon indicating copy to clipboard operation
jupyter_client copied to clipboard

Cannot configure ports if 'transport' is 'tcp'

Open yves-surrel opened this issue 2 years ago • 6 comments

Changing the shell_port, iopub_port etc. in jupyter_console_config.py does not work, neither does using jupyter console --iopub:xxxx in the command line.

After investigation, it comes from the cache_ports attribute of KernelManager:

    def _default_cache_ports(self) -> bool:
        return self.transport == "tcp"

in `manager.py' and

            if km.cache_ports and not self.ports_cached:
                lpc = LocalPortCache.instance()
                km.shell_port = lpc.find_available_port(km.ip)
                km.iopub_port = lpc.find_available_port(km.ip)
                km.stdin_port = lpc.find_available_port(km.ip)
                km.hb_port = lpc.find_available_port(km.ip)
                km.control_port = lpc.find_available_port(km.ip)
                self.ports_cached = True

in async def pre_launch in local_provisioner.py.

Maybe related to #492

Jupiter_client v 7.3.5

yves-surrel avatar Nov 13 '22 10:11 yves-surrel