Changeset 3865

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

* Enhance node side timeout message to enable understanding what happened

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.4-stable/node/lib/Munin/Node/Server.pm

    r3611 r3865  
    133133    _net_write($session, "# munin node at $config->{fqdn}\n"); 
    134134 
     135    my $line = '<no command received yet>'; 
     136 
    135137    # catch and report any system errors in a clean way. 
    136138    eval { 
     139        # BUG: It appears that the plugin timeout is still in place 
     140        # when _net_read is executing.  Meaning that if the previous 
     141        # plugin takes close to $timeout time then there is very very 
     142        # short time for munin-update to issue a new command. 
     143        #  
    137144        $timed_out = !do_with_timeout($config->{'timeout'}, sub { 
    138             while (defined (my $line = _net_read($session))) { 
     145            while (defined ($line = _net_read($session))) { 
    139146                chomp $line; 
    140                 _process_command_line($session, $line) or last; 
     147                if (! _process_command_line($session, $line)) { 
     148                    $line = "<finished '$line', ending input loop>"; 
     149                    last; 
     150                } 
     151                $line = "<waiting for input from master, previous was '$line'>"; 
    141152            } 
    142153        }); 
     
    148159 
    149160    if ($timed_out) { 
    150         logger("Connection timed out"); 
     161        logger("Node side timeout while processing: '$line'"); 
    151162    } 
    152163