).start()
self._retry_connect_in_s *= 2
+ def consider_retry(self) -> None:
+ 'Interpret .db.connection_state, on triggers set retry connect.'
+ if self.db.connection_state.endswith('timed out)')\
+ and not self._retry_connect_in_s > 0:
+ self._retry_connect_in_s = 1
+
def close(self) -> None:
'Close connection, wipe memory of its states, reconnect if indicated.'
if not self._autojoins:
'ERROR',
_MsgTok.NONE,
((_MsgTok.ANY, 'setattr_db:connection_state'),),
- bonus_tasks=('doafter_close:',)),
+ bonus_tasks=('do_consider_retry:', 'doafter_close:',)),
_MsgParseExpectation(
'PING',
, ..$ DISCONNECTED
1 .!$ will retry connecting in 1 seconds
repeat conn-full-in conn-full-out
+:0:1 ..< ERROR :Closing link: (Connection timed out)
+1 ..$ connection_state set to: [Closing link: (Connection timed out)]
+1 ..$ isupport cleared
+1 ..$ isupport:CHANTYPES set to: [#&]
+1 ..$ isupport:PREFIX set to: [(ov)@+]
+1 ..$ isupport:USERLEN set to: [10]
+1 ..$ connection_state set to: []
+wait 1
+, ..$ DISCONNECTED
+1 .!$ will retry connecting in 1 seconds
+repeat conn-full-in conn-full-out
+
+# test retry chain started by "timed out)" ERROR
# on second server, check timed auto-retries don't activate after manual intervention
> /connect baz.bar.foo:10003 foo:bar baz:foobarbazquux