Skip to content

Commit 0a35f5d

Browse files
author
chengcong
committed
fix connection exception cause high cpu load
adjust err log
1 parent e544fa1 commit 0a35f5d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

jupyter_server/gateway/connections.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ def handle_incoming_message(self, message: str) -> None:
147147
"""Send message to gateway server."""
148148
if self.ws is None and self.ws_future is not None:
149149
loop = IOLoop.current()
150+
if self.ws_future.done():
151+
self.log.error(f"Exception connect to gateway server {self.ws_future.exception()}")
152+
return
150153
loop.add_future(self.ws_future, lambda future: self.handle_incoming_message(message))
151154
else:
152155
self._write_message(message)

0 commit comments

Comments
 (0)