Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
re-resolve DNS record if the connection broke #195
Comments
khepler
commented
Jul 23, 2015
|
Also a problem when a server moves to a different IP. Had a client constantly trying to connect to an old IP after DNS pointed to the new one. Only picked up the new IP after /rmreconns and /connect cycle. |
|
|
ailin-nemui
added
bug
enhancement
labels
Dec 9, 2015
|
Quick and dirty analysis of what (I suppose) happens here. Now let's walk up the signal chain, we discover that the signal So it's either a case of pebkac where the user is connected by specifying a fixed ip, meaning that we can't rely on getting a fresh and working ip when reconnecting, or it's irssi at fault here. |
|
Quick follow up to the previous investigation work. |
khepler
commented
Jan 27, 2016
|
In my case the server was certainly specified by DNS, and the server does not support IPv6. |
|
Do you mean that irssi wasn't trying to resolve an ip address in your case ? |
khepler
commented
Jan 28, 2016
|
I specified the server by DNS hostname when I started the program. I did not specify an IP address. Unfortunately I do not know if irssi was making any name lookups after the server IP changed. The messages in the transcript referenced the server by hostname, but it repeatedly tried reconnecting to the old IP address. The client system was able to resolve the new IP with other programs (ping, host) while irssi was reconnecting, and other services reconnected to the server while irssi continued to attempt reconnect. irssi reconnected the instant I /QUIT and restarted it with the command line selected from shell history and not modified. |
|
If the messages were like this
Where hostname is the one to resolve and ip is the same one every time then I think it's a different problem. |
wilhelmy
commented
Jan 28, 2016
|
I'm connecting to irc.freenode.net, so I doubt this was a case of PEBCAK with a fixed IP I'm connecting to; at least resolving irc.freenode.net with host(1) returns the entire round robin and there is no entry in /etc/hosts. For the record, I'm using FreeBSD, in case their libc resolver functions work differently. I haven't tried reproducing the issue on linux. @khepler have you had the issue on IPv4 by chance? Maybe it's an IPv6 issue related to the fact that IPv6 addresses look differently and could potentially break some internal parsing code? Edit: I don't remember whether or not I had the issue on IPv4. Sorry about that.
hm, guess that's not it, then. Sorry, nevermind. |
wilhelmy
commented
Jan 28, 2016
|
@LemonBoy my guess is that the resolving code either caches DNS lookups or the lookups are returned in the same order every time. My suggested fix is shuffling them around in case of a connection error, I guess, and making sure you're connecting to a different server the next time, if one is present and no address family is specified. |
|
The issue you've reported should be fixed by the pending PR, it sounds like the reverse lookup failed and the hostname got overwritten by the ipv6 address. The DNS resolver is already shuffling the record that gets selected (and this is a separate problem). So if we managed to pick the same one over and over that means fhe random number generator is heavily skewed (and broken)...perhaps a single result is returned ? |
wilhelmy
commented
Jan 28, 2016
|
Sounds like it. Thanks for tracking down and fixing the issue regarding the missing PTR record! |
|
as this change is integrated in git, I will close this for now. please reopen if you encounter this issue again with latest git |
wilhelmy commentedJan 1, 2015
It keeps going on like this until I manually issue
/rmreconnsand/connect FreenodeIdeally, it would re-resolve the rrDNS on chat.freenode.net and connect to a different IP in the round-robin in case the connection fails.