aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2022-11-13 18:39:34 +0000
committerPascal Terjan <pterjan@mageia.org>2023-01-19 20:20:50 +0000
commitcfcd4507544f1c57802925255ecdfb9234f1feee (patch)
tree22c9ec1a0d5005aaa148c85fa772acf197b143e1 /lib
parent70c540ae9f2c4f395712726a08b0db6365b2044d (diff)
downloadiurt-cfcd4507544f1c57802925255ecdfb9234f1feee.tar
iurt-cfcd4507544f1c57802925255ecdfb9234f1feee.tar.gz
iurt-cfcd4507544f1c57802925255ecdfb9234f1feee.tar.bz2
iurt-cfcd4507544f1c57802925255ecdfb9234f1feee.tar.xz
iurt-cfcd4507544f1c57802925255ecdfb9234f1feee.zip
Increase robustness when scp fails0.8.0
Do not remove lock file and mark build as done until we copied all the files.
Diffstat (limited to 'lib')
-rw-r--r--lib/Iurt/Queue.pm10
-rwxr-xr-xlib/Iurt/Ulri.pm8
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/Iurt/Queue.pm b/lib/Iurt/Queue.pm
index 2f1e968..585294e 100644
--- a/lib/Iurt/Queue.pm
+++ b/lib/Iurt/Queue.pm
@@ -15,6 +15,7 @@ our @EXPORT = qw(
check_if_all_archs_processed
check_if_mandatory_arch_failed
load_lock_file_data
+ record_bot_complete
remove_bot_from_package
);
@@ -183,6 +184,15 @@ sub remove_bot_from_package {
@{$ent->{media}{$media}{bot}} = grep { $_->{host} ne $host || $_->{pid} != $pid} @{$ent->{media}{$media}{bot}};
}
+sub record_bot_complete {
+ my ($run, $bot, $arch, $lock_file, $prefix, $ent, $media, $host, $pid) = @_;
+ plog('INFO', "delete lock file for $prefix on $host/$arch");
+ unlink $lock_file;
+ $run->{bot}{$host}{$bot} = 0;
+ remove_bot_from_package($ent, $media, $host, $pid);
+ $ent->{media}{$media}{arch}{$arch} = 0;
+}
+
sub get_upload_tree_state {
our ($config) = @_;
diff --git a/lib/Iurt/Ulri.pm b/lib/Iurt/Ulri.pm
index 6d4e38f..f2e014c 100755
--- a/lib/Iurt/Ulri.pm
+++ b/lib/Iurt/Ulri.pm
@@ -12,6 +12,7 @@ use strict;
our @EXPORT = qw(
build_package
+ fetch_logs_and_cleanup
warn_about_failure
);
@@ -144,6 +145,13 @@ sub get_pid_from_file {
$pid;
}
+sub fetch_logs_and_cleanup {
+ my ($remote, $remote_dir, $target_dir) = @_;
+ make_path($target_dir);
+ sget($remote, "$remote_dir/log/*", $target_dir);
+ ssh($remote, "rm -rf $remote_dir");
+}
+
sub warn_about_failure {
my ($config, $user, $ent, $arch, $fail_dir, $path, $prefix) = @_;
my $text = join("\n", "Build of the following packages failed:\n", map { "- $_" } @{$ent->{srpms}}) . "\n";