Open
Description
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:
- add breakpoint at this function
- start a session in browser
- kill kernel in gateway