Open
Description
Description:
A critical issue was identified in the previous WebSocket connection message handling logic where messages could enter an infinite retry loop during connection establishment.
Current Behavior:
When a message arrives while WebSocket connection is being established (self.ws is None
but self.ws_future
exists), the code recursively adds the message handling as a future callback, potentially creating an infinite loop if the connection fails repeatedly.
Technical Details:
- Location:
- Class:
- Previous problematic code pattern:
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))