Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The gateway connection bug causes high CPU load #1483

Open
dualc opened this issue Dec 18, 2024 · 1 comment · May be fixed by #1484
Open

The gateway connection bug causes high CPU load #1483

dualc opened this issue Dec 18, 2024 · 1 comment · May be fixed by #1484
Labels

Comments

@dualc
Copy link

dualc commented Dec 18, 2024

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 dualc added the bug label Dec 18, 2024
@dualc dualc linked a pull request Dec 18, 2024 that will close this issue
@minrk
Copy link
Contributor

minrk commented Dec 19, 2024

Where do you see a loop? This function is called once per message, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants