Skip to content

The gateway connection bug causes high CPU load #1483

Open
@dualc

Description

@dualc

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions