IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26875


Ignore:
Timestamp:
Feb 10, 2010, 4:17:14 PM (16 years ago)
Author:
eugene
Message:

updates from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/Nebulous-Server/bin/nebdiskd

    r26292 r26875  
    6767$retry      ||= $c->get_retry   || 1;
    6868
     69# stuff to controll failures.
     70my %host_failure_counts = ();
     71my $failure_limit = 5;
     72
     73
     74
    6975#my $mounts = $c->get_mounts;
    7076my $poll_interval = $c->get_poll_interval || 5;
     
    133139$SIG{INT}  = $SIG{TERM};
    134140$SIG{HUP}  = sub { $c = read_rcfile($rcfile) };
     141
    135142
    136143while (1) {
     
    202209            my $tries = 0;
    203210            my $valid_mountpoint = 1;
     211            unless (exists($host_failure_counts{$mountpoint})) {
     212                $host_failure_counts{$mountpoint} = 0;
     213            }
    204214            TEST: eval {
    205215                $tries++;
     
    215225                    goto TEST;
    216226                }
    217                 $log->warn("Removing $mountpoint from the mountedvol table ($tries > $retry)");
    218  #               $log->warn($@);
    219 
    220                 $d_query->execute($mountpoint);
     227                $host_failure_counts{$mountpoint}++;
     228
     229                if ($host_failure_counts{$mountpoint} > $failure_limit) {
     230                    $log->warn("Removing $mountpoint from the mountedvol table ($host_failure_counts{$mountpoint} > $failure_limit)");
     231                    $d_query->execute($mountpoint);
     232                }
     233                else {
     234                    $log->warn("Mountpoint $mountpoint has had $host_failure_counts{$mountpoint} failures. Will remove after $failure_limit");
     235                }
    221236                next;
    222237            }
     238            if ($host_failure_counts{$mountpoint} != 0) {
     239                $log->warn("Mountpoint $mountpoint failures cleared ($host_failure_counts{$mountpoint})");
     240                $host_failure_counts{$mountpoint} = 0;
     241            }
    223242
    224243            # fetch stats on the mounted device.  this has to be done AFTER
Note: See TracChangeset for help on using the changeset viewer.