Ticket #498 (closed defect: fixed)
IRC client fails to reconnect after IP change.
| Reported by: | ipv6guru | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 0.8.6 |
| Version: | 0.7.10 | Keywords: | irc |
| Cc: |
Description
When buildbot is running on a machine with dynamic IP the IRC client won't rejoin after an IP change.
It will never get a clientConnectionLost because no data is send over the TcpConnection?.
Christoph von Wittich Christoph@…
Submitted: Nobody/Anonymous? ( nobody ) - 2006-08-25 07:19
Extra Comments :-
Date: 2007-01-31 09:43 Sender: r33d
While most IRCds actually send you a PING with a random token that you need to send back in order to remain connected, it seems that other IRCds do not. One way of fixing this is by pinging yourself through the server. Just send a CTCP PING to yourself and calculate how long it takes to get back to you. If it never comes back within a certain time period, you probably have been disconnected and should reconnect. I'll ponder some more on this.
Date: 2007-01-31 09:34 Sender: warner
yeah, we need to have something in the IRC bot that pings or otherwise generates some traffic every once in a while. I think that would be enough to trigger a connectionLost, after which the usual ReconnectingClientFactory? behavior ought to be enough to make it reconnect (with the new IP address).
Does anyone know which IRC command we should use? I know that PING is usually directed at someone else.. what can we do to just make sure we can still talk to the ircd?
Change History
comment:3 Changed 3 years ago by ddunbar
- Summary changed from IRC bot problem to IRC client fails to reconnect after IP change.
Retitled to match description.
comment:4 Changed 21 months ago by dustin
- Keywords irc added; sourceforge 1546325 removed
In general, the IRC bot should use some kind of keepalives.
comment:5 Changed 4 months ago by tom.prince
A data point: So, my irc bot stopped being connected, and didn't reconnect. I went into the manhole, and it thought it was still connected. Then I poked it, and managed to get it to reconnect. I think it might have been due to my internet connection being down for a period of time today, and it seems it didn't notice that it lost the connection.
comment:6 Changed 4 months ago by tom.prince
I tried adding a LoopingCall? that I start in IrcStatusBot?.connectionMade and stop in IrcStatusBot?.connectionLost, that calls self.ping(self.nickname).
It tested by using iptables to block outgoing packets to the IRC server, and after ~4min (and pings) it tried reconnecting (which worked, since it connected to a different server on the same network).
comment:7 Changed 4 months ago by dustin
- Status changed from new to closed
- Resolution set to fixed
Thanks, Tom!
commit 0611f55dd88c3bd18c97e88905910719304c8fa0
Author: Tom Prince <tom.prince@ualberta.net>
Date: Wed Oct 5 21:30:53 2011 -0400
irc: Send keep-alive to detect lost connections.
Fixes #498.
re-open if this doesn't fix it.
![[Buildbot Logo]](/chrome/site/header-text-transparent.png)
Moved from sourceforge