Closed Altreus closed 4 years ago
This came from the fix-existing-comms
branch; behaviour on master is weirder
This seems to have faded away. We should try to test it.
This still happens, but it can take a long time.
« ♥
« ♥
Unhandled exception in code scheduled on thread 8
Cannot send on a closed WebSocket connection
in method ensure-open at /home/altreus/rakus/rakudo-2020.02.1/share/perl6/site/sources/2168AC86EF429E6C017A051527384770C7281F2E (Cro::WebSocket::Client::Connection) line 171
in method send at /home/altreus/rakus/rakudo-2020.02.1/share/perl6/site/sources/2168AC86EF429E6C017A051527384770C7281F2E (Cro::WebSocket::Client::Connection) line 105
in block at /home/altreus/rakus/rakudo-2020.02.1/share/perl6/site/sources/72317C3AF2317FAA95422F5F9CECEEC782156F90 (API::Discord::Connection) line 182
This is probably caused by the heartbeat being sent, because nothing else was being done.
Observe that we get two outbound heartbeat requests and no inbound. It looks like we send the next heartbeat request, instead of trying to reconnect because we didn't hear back.
I'm extending this issue to reconnection in general. I think I've managed to get the two issues to converge at the same point.
Here is my current output from Connection.pm6
when Discord tells us to reconnect:
reconnect
Closing connection
closed
connect ...
New websocket connection...
Done
Stopping message handler
Starting message handler
Now nothing happens - but it should be responding to events from the new websocket!
Closing this in favour of #41
Seems like we never find out if the websocket was closed: