Skip to content

Commit

Permalink
master: check for timeout before checking for failure to connect.
Browse files Browse the repository at this point in the history
Without this change, even in the case of timeout you'll have a failure
to connect, as $res will be undefined anwyay. Reversing the checks
fixes one test as well.
  • Loading branch information
Flameeyes authored and steveschnepp committed Nov 13, 2012
1 parent bd1c7f4 commit 8a6c833
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions master/lib/Munin/Master/ProcessManager.pm
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,14 @@ sub _do_work {
$res = $worker->do_work();
return 1;
});
if (!defined($res)) {
ERROR "[ERROR] $worker failed to connect to node";
$retval = $E_CONNECT;
} elsif ($timed_out) {
if ($timed_out) {
ERROR "[ERROR] $worker timed out";
$res = undef;
$retval = $E_TIMED_OUT;
}
} elsif (!defined($res)) {
ERROR "[ERROR] $worker failed to connect to node";
$retval = $E_CONNECT;
}
};
if ($EVAL_ERROR) {
ERROR "[ERROR] $worker died with '$EVAL_ERROR'";
Expand Down

0 comments on commit 8a6c833

Please sign in to comment.