From: minima Date: Tue, 10 Apr 2001 10:06:50 +0000 (+0000) Subject: send only pc39 and no pc21s when shuttinng down X-Git-Tag: R_1_47~36 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=5b0cb88ef61ecda87a29033d8fc70edc617afc62;p=spider.git send only pc39 and no pc21s when shuttinng down --- diff --git a/Changes b/Changes index 9452892f..945bf383 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,9 @@ 1. fixed more of the "xxx disappeared from yyy" messages 2. altered the build no logic so that it always checksums the same files regardless of whatever else you might have in the directory. +3. made shortcut at shutdown so that you don't get a storm of PC21s on busy +nodes as each connection goes down. Just send a pc39 to each interface and +nothing else. 10Apr01======================================================================= 1. altered PC21 logic somewhat to eliminate dup PC21s 2. disconnect should remove dangling local users in the routing table. diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 8687a494..e92ca8a1 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -1688,10 +1688,10 @@ sub addrcmd sub disconnect { my $self = shift; - my $nopc39 = shift; + my $pc39flag = shift; my $call = $self->call; - unless ($nopc39) { + unless ($pc39flag && $pc39flag == 1) { $self->send_now("D", DXProt::pc39($main::mycall, $self->msg('disc1', "System Op"))); } @@ -1709,10 +1709,12 @@ sub disconnect } # broadcast to all other nodes that all the nodes connected to via me are gone - unless ($self->{isolate}) { - push @nodes, $call; - for (@nodes) { - broadcast_ak1a(pc21($_, 'Gone.'), $self); + unless ($pc39flag && $pc39flag == 2) { + unless ($self->{isolate}) { + push @nodes, $call; + for (@nodes) { + broadcast_ak1a(pc21($_, 'Gone.'), $self); + } } } diff --git a/perl/cluster.pl b/perl/cluster.pl index 3bed469c..20e80ddb 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -227,7 +227,7 @@ sub cease # disconnect users foreach $dxchan (DXChannel->get_all()) { next if $dxchan->is_node; - $dxchan->disconnect unless $dxchan == $DXProt::me; + $dxchan->disconnect(2) unless $dxchan == $DXProt::me; } # disconnect AGW @@ -246,8 +246,8 @@ sub cease DXDb::closeall; # close all listeners - for (@listeners) { - $_->close_server; + foreach my $l (@listeners) { + $l->close_server; } dbg('chan', "DXSpider version $version, build $build ended"); @@ -381,11 +381,11 @@ my $conn = IntMsg->new_server($clusteraddr, $clusterport, \&login); $conn->conns("Server $clusteraddr/$clusterport"); push @listeners, $conn; dbg('err', "Internal port: $clusteraddr $clusterport"); -for (@main::listen) { - $conn = ExtMsg->new_server($_->[0], $_->[1], \&login); - $conn->conns("Server $_->[0]/$_->[1]"); +foreach my $l (@main::listen) { + $conn = ExtMsg->new_server($l->[0], $l->[1], \&login); + $conn->conns("Server $l->[0]/$l->[1]"); push @listeners, $conn; - dbg('err', "External Port: $_->[0] $_->[1]"); + dbg('err', "External Port: $l->[0] $l->[1]"); } AGWrestart();