jupyter_server icon indicating copy to clipboard operation
jupyter_server copied to clipboard

The gateway connection bug causes high CPU load

Open dualc opened this issue 10 months ago • 1 comments

I found a bug about the gateway module,which will cause high cpu load in some situation。code as below

 def handle_incoming_message(self, message: str) -> None:
        """Send message to gateway server."""
        if self.ws is None and self.ws_future is not None:
            loop = IOLoop.current()
            loop.add_future(self.ws_future, lambda future: self.handle_incoming_message(message))
        else:
            self._write_message(message)

Reproduce

when the connectionto juptyer server is ready,but the connection to gateway kernel is not ready and then kernel exit,code will cause dead loop,because the if condition is always true reproduce it:

  1. add breakpoint at this function
  2. start a session in browser
  3. kill kernel in gateway

dualc avatar Dec 18 '24 15:12 dualc