diff options
-rwxr-xr-x | ulri | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -299,11 +299,17 @@ foreach my $prefix (keys %pkg_tree) { # Everything is fine, build is continuing! next bot; } - # TODO: In case of timeout, kill it! - # It should be a matter of kill -14 $pid, that should trigger cleanup - # We should then keep the lock and wait to fetch/clean the logs - plog('FAIL', "$bot timed out on $host/$arch ($seconds sec) or " . - "it's dead (status $proc_state), removing lock"); + if ($timeout) { + plog('FAIL', "$bot timed out on $host/$arch ($seconds sec), killing it"); + ssh($remote, "kill -14 $pid"); + # Give it some time to die/cleanup + if ($seconds < 1.02 * $config->{faildelay}) { + next bot; + } + plog('FAIL', "$bot didn't die after timing out on $host/$arch, removing lock"); + } else { + plog('FAIL', "$bot died on $host/$arch (status $proc_state), removing lock"); + } $pkg_tree{$prefix}{media}{$media}{arch}{$arch} = 0; } @@ -315,6 +321,7 @@ foreach my $prefix (keys %pkg_tree) { $run{bot}{$host}{$bot} = 0; if (!$status) { + # TODO: fetch/clean the logs next bot; } |