Skip to content

Commit

Permalink
fix connection exception cause high cpu load
Browse files Browse the repository at this point in the history
adjust err log
  • Loading branch information
chengcong committed Dec 18, 2024
1 parent e544fa1 commit 0a35f5d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jupyter_server/gateway/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ 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()
if self.ws_future.done():
self.log.error(f"Exception connect to gateway server {self.ws_future.exception()}")
return
loop.add_future(self.ws_future, lambda future: self.handle_incoming_message(message))
else:
self._write_message(message)
Expand Down

0 comments on commit 0a35f5d

Please sign in to comment.