A lightweight, multi-tenant, scalable and secure gateway that enables Jupyter Notebooks to share resources across distributed clusters such as Apache Spark, Kubernetes and others.
Instead of restarting the blocking accept call, we can use select.select to check ready-state of the socket. Using this method we don't cycle the connection and delay (or miss) messages.
For every message send from the Enterprise Gateway to the kernel, a new connection is accepted using
socket.accept()
. The timeout for this socket is 5 seconds: https://github.com/jupyter-server/enterprise_gateway/blob/d01e84a2457d44d14bd6bd3335307b9d0e3b483d/etc/kernel-launchers/python/scripts/launch_ipykernel.py#L293Instead of restarting the blocking
accept
call, we can useselect.select
to check ready-state of the socket. Using this method we don't cycle the connection and delay (or miss) messages.