From 71c0127b2afcfa59a780926dfd05605133b833fb Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Sun, 14 Oct 2018 21:23:06 +0000 Subject: Try killing the build when ulri sees a timeout This only matters if the build node for some reason has a larger timeout than the main config, in which case we were forgetting about it. --- ulri | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ulri b/ulri index 6009279..5398a9b 100755 --- a/ulri +++ b/ulri @@ -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; } -- cgit v1.2.1