upissued version no
[spider.git] / perl / cluster.pl
index aa44006786c5d382925d10e45cb324f0ca162766..d026edd66617667bfeaf1010b07b5aaac83606cd 100755 (executable)
@@ -71,7 +71,7 @@ package main;
 
 @inqueue = ();                                 # the main input queue, an array of hashes
 $systime = 0;                                  # the time now (in seconds)
-$version = "1.41";                             # the version no of the software
+$version = "1.42";                             # the version no of the software
 $starttime = 0;                 # the starting time of the cluster   
 $lockfn = "cluster.lock";       # lock file name
 @outstanding_connects = ();     # list of outstanding connects
@@ -106,6 +106,11 @@ sub rec
        
        if (!defined $msg || (defined $err && $err)) {
                if ($dxchan) {
+                       if (defined $err) {
+                               $conn->disconnect;
+                               undef $conn;
+                               $dxchan->conn(undef);
+                       }
                        $dxchan->disconnect;
                } elsif ($conn) {
                        $conn->disconnect;
@@ -375,6 +380,11 @@ dbg('err', "orft we jolly well go ...");
 
 #open(DB::OUT, "|tee /tmp/aa");
 
+$SIG{PIPE} = sub { 
+       #$DB::single = 1;  
+       dbg('err', "Broken PIPE signal received"); 
+};
+
 for (;;) {
        my $timenow;
 #      $DB::trace = 1;