When the SingleServerIRCBot gets disconnected by the IRC server, it improperly handles reconnecting, causing it to double it's reconnect attempts every reconnect_interval under certain conditions.
Cause
The code handling disconnects is the following:
def _on_disconnect(self, c, e):
self.channels = IRCDict()
self.connection.execute_delayed(self.reconnection_interval,
self._connected_checker)
After a reconnection_interval the _connected_checker gets called.
def _connected_checker(self):
"""[Internal]"""
if not self.connection.is_connected():
self.connection.execute_delayed(self.reconnection_interval,
self._connected_checker)
self.jump_server()
Which schedule another connection check and calls jump_server() to try to reconnect. If the connection attempt done by jump_server() is successful, but the client is disconnected by the IRC server (for example due to being banned), then _on_disconnect is dispatched, which schedules another connection check. And thus one connection check has turned into two.
When the
SingleServerIRCBotgets disconnected by the IRC server, it improperly handles reconnecting, causing it to double it's reconnect attempts everyreconnect_intervalunder certain conditions.Cause
The code handling disconnects is the following:
After a
reconnection_intervalthe_connected_checkergets called.Which schedule another connection check and calls
jump_server()to try to reconnect. If the connection attempt done byjump_server()is successful, but the client is disconnected by the IRC server (for example due to being banned), then_on_disconnectis dispatched, which schedules another connection check. And thus one connection check has turned into two.