diff options
author | Pascal Terjan <pterjan@mageia.org> | 2018-10-15 13:39:53 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mageia.org> | 2018-10-15 13:41:23 +0000 |
commit | be6d5900263c9641739e883eb98f9bf578b9eaba (patch) | |
tree | c313457e54af5038d464344c626049091fb79fab | |
parent | 8258dcc8fd346aa2036a1fc469c41dfca2274f5d (diff) | |
download | iurt-be6d5900263c9641739e883eb98f9bf578b9eaba.tar iurt-be6d5900263c9641739e883eb98f9bf578b9eaba.tar.gz iurt-be6d5900263c9641739e883eb98f9bf578b9eaba.tar.bz2 iurt-be6d5900263c9641739e883eb98f9bf578b9eaba.tar.xz iurt-be6d5900263c9641739e883eb98f9bf578b9eaba.zip |
Ignore failures when cancelling builds
This will avoid listing other architectures as failed, and giving
some confusing logs.
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | lib/Iurt/Queue.pm | 2 | ||||
-rwxr-xr-x | ulri | 30 |
3 files changed, 22 insertions, 12 deletions
@@ -1,3 +1,5 @@ +- ulri: ignore failures when cancelling build + 0.7.7 - ulri: only use mandatory archs for noarch builds - ulri: kill builds for other architectures in case of failure diff --git a/lib/Iurt/Queue.pm b/lib/Iurt/Queue.pm index 449ec36..317f301 100644 --- a/lib/Iurt/Queue.pm +++ b/lib/Iurt/Queue.pm @@ -236,6 +236,8 @@ sub get_upload_tree_state { $pkg_tree{$prefix}{media}{$media}{excluded_arch}{$arch} = 1; } elsif ($result eq 'fail') { $pkg_tree{$prefix}{media}{$media}{failed_arch}{$arch} = 1; + } elsif ($result eq 'cancelled') { + $pkg_tree{$prefix}{media}{$media}{cancelled_arch}{$arch} = 1; } else { plog('WARNING', "unknown state $arch.$result for $prefix"); } @@ -300,6 +300,8 @@ foreach my $prefix (keys %pkg_tree) { # Kill it if that package had failed on a mandatory arch if (check_if_mandatory_arch_failed($media, $prefix, $ent, $config)) { ssh($remote, "kill -14 $pid"); + $pkg_tree{$prefix}{media}{$media}{cancelled_arch}{$arch} = 1; + create_file("$done_dir/${prefix}_$arch.cancelled", "$bot $host"); } next bot; } @@ -407,12 +409,15 @@ foreach my $prefix (keys %pkg_tree) { make_path($fail_dir); - mkdir("$fail_dir/$prefix"); - if (sget($remote, "$prefix_dir/*", "$fail_dir/$prefix")) { - plog('ERROR', "copying from $host:$prefix_dir/ " . - "to $fail_dir/ failed ($!)"); - $pkg_tree{$prefix}{media}{$media}{arch}{$arch} = 0; + unless ($pkg_tree{$prefix}{media}{$media}{cancelled_arch}{$arch}) { + mkdir("$fail_dir/$prefix"); + if (sget($remote, "$prefix_dir/*", "$fail_dir/$prefix")) { + plog('ERROR', "copying from $host:$prefix_dir/ " . + "to $fail_dir/ failed ($!)"); + $pkg_tree{$prefix}{media}{$media}{arch}{$arch} = 0; + } } + # clean the log on the compilation machine ssh($remote, "rm -rf $prefix_dir"); @@ -421,16 +426,17 @@ foreach my $prefix (keys %pkg_tree) { cleanup_failed_build($todo_dir, $done_dir, $fail_dir, $prefix, $ent, $media, $arch, $config); - plog('FAIL', "build failed"); - create_file("$done_dir/${prefix}_$arch.fail", "$bot $host"); - $pkg_tree{$prefix}{media}{$media}{failed_arch}{$arch} = 1; + unless ($pkg_tree{$prefix}{media}{$media}{cancelled_arch}{$arch}) { + plog('FAIL', "build failed"); + create_file("$done_dir/${prefix}_$arch.fail", "$bot $host"); + $pkg_tree{$prefix}{media}{$media}{failed_arch}{$arch} = 1; - # Notify user if build failed - if ($user) { - warn_about_failure($config, $user, $ent, $arch, $fail_dir, $path, $prefix); + # Notify user if build failed + if ($user) { + warn_about_failure($config, $user, $ent, $arch, $fail_dir, $path, $prefix); + } } - } # end bot } # end path } # end prefix |