Commit a9827417 authored by David Johnson's avatar David Johnson

Do not fail iptables rules gen on name resolution failure.

Under high load, of course we can have DNS problems.  However, perl
seems to get stuck on retry; it's like the nak gets cached (which would
be extremely odd, but can't argue with the evidence).

Anyway, if resolution continues to fail, give up and feed the name to
iptables, and let it try :).
parent 642d15f8
......@@ -3240,24 +3240,29 @@ sub vnodePreConfigControlNetwork($$$$$$$$$$$$)
warn("could not find bossip anywhere; aborting!");
return -1;
}
my $retries = 30;
my $retries = 4;
my @addrs = ();
my $uname = "users";
while ($retries > 0) {
(undef,undef,undef,undef,@addrs) = gethostbyname("users");
(undef,undef,undef,undef,@addrs) = gethostbyname($uname);
if ($? || @addrs == 0) {
warn("could not resolve users.$bossdomain; retrying!");
sleep(2);
warn("could not resolve $uname; retrying!");
sleep(4);
}
else {
last;
}
$uname = "users.$shortdomain";
$retries -= 1;
}
my $ops_ip;
if (@addrs == 0) {
warn("could not resolve users.$bossdomain; aborting!");
return -1;
warn("could not resolve users.$bossdomain; sending name to iptables!");
$ops_ip = "users";
}
else {
$ops_ip = inet_ntoa($addrs[0]);
}
my $ops_ip = inet_ntoa($addrs[0]);
my $local_tmcd_port = $TMCD_PORT + $vmid;
#
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment