Changeset 3864

Show
Ignore:
Timestamp:
08/18/10 13:47:42 (1 year ago)
Author:
janl
Message:

* Better node side timeout error message allowing things to be found out if needed

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/node/lib/Munin/Node/Server.pm

    r3743 r3864  
    143143    _net_write($session, "# munin node at $config->{fqdn}\n"); 
    144144 
     145    my $line = '<no command received yet>'; 
     146 
    145147    # catch and report any system errors in a clean way. 
    146148    eval { 
     149        # BUG: It appears that the plugin timeout is still in place 
     150        # when _net_read is executing.  Meaning that if the previous 
     151        # plugin takes close to $timeout time then there is very very 
     152        # short time for munin-update to issue a new command. 
     153        #  
     154 
    147155        $timed_out = !do_with_timeout($services->{timeout}, sub { 
    148             while (defined (my $line = _net_read($session))) { 
     156            while (defined ($line = _net_read($session))) { 
    149157                chomp $line; 
    150                 _process_command_line($session, $line) or last; 
     158                if (! _process_command_line($session, $line)) { 
     159                    $line = "<finished '$line', ending input loop>"; 
     160                    last; 
     161                } 
     162                $line = "<waiting for input from master, previous was '$line'>"; 
    151163            } 
    152164        }); 
    153165    }; 
    154166 
    155     logger($EVAL_ERROR)            if ($EVAL_ERROR); 
    156     logger("Connection timed out") if ($timed_out); 
     167    logger($EVAL_ERROR)                                   if ($EVAL_ERROR); 
     168    logger("Node side timeout while processing: '$line'") if ($timed_out); 
    157169 
    158170    return;