Changeset 3271

Show
Ignore:
Timestamp:
12/30/09 12:19:05 (2 years ago)
Author:
janl
Message:

* Make munin-update --nofork not die when nodes are unavailable. Closes #800.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/master/lib/Munin/Master/Node.pm

    r3221 r3271  
    450450sub _node_read_single { 
    451451    my ($self) = @_; 
    452     my $res
     452    my $res = undef
    453453 
    454454    my $timed_out = !do_with_timeout($self->{io_timeout}, sub { 
     
    465465            ".  Terminating process."; 
    466466    } 
     467    if (!defined($res)) { 
     468        # Probable socket not open.  Why are we here again then? 
     469        # aren't we supposed to be in "do in session"? 
     470        LOGCROAK "[FATAL] Socket read from ".$self->{host}." failed.  Terminating process."; 
     471    } 
    467472    DEBUG "[DEBUG] Reading from socket to ".$self->{host}.": \"$res\"."; 
    468473    return $res; 
  • trunk/master/lib/Munin/Master/Update.pm

    r3214 r3271  
    164164    else { 
    165165        for my $worker (@{$self->{workers}}) { 
    166             my $res = $worker->do_work(); 
     166 
     167            my $res ; 
     168 
     169            eval { 
     170                # do_work fails hard on a number of conditions 
     171                $res = $worker->do_work(); 
     172            }; 
     173 
     174            $res=undef if $EVAL_ERROR; 
     175 
    167176            my $worker_id = $worker->{ID}; 
    168177            if (defined($res)) {