[Mageia-sysadm] [319] Have only one instance of the bot running per host at a time, even if they are building for different arch

root at mageia.org root at mageia.org
Tue Jan 18 23:30:20 CET 2011


Revision: 319
Author:   pterjan
Date:     2011-01-18 23:30:20 +0100 (Tue, 18 Jan 2011)
Log Message:
-----------
Have only one instance of the bot running per host at a time, even if they are building for different arch

Modified Paths:
--------------
    build_system/iurt/trunk/ulri

Modified: build_system/iurt/trunk/ulri
===================================================================
--- build_system/iurt/trunk/ulri	2011-01-18 20:57:56 UTC (rev 318)
+++ build_system/iurt/trunk/ulri	2011-01-18 22:30:20 UTC (rev 319)
@@ -165,7 +165,6 @@
 
 $run{pidfile_home} = $config->{tmp};
 $run{pidfile} = "upload";
-my $pidfile = check_pid(\%run);
 
 #my $cache = init_cache(\%run, $config, { done => {} });
 my $cache = { done => {} };
@@ -236,7 +235,7 @@
 	    $arch =~ s/-.*//;
 	}
 
-	$run{bot}{$arch}{$host}{$bot} = $prefix;
+	$run{bot}{$host}{$bot} = $prefix;
 
 	# this should be in the cache, but waiting for a cache-clean option
 	$compildone->{$prefix}{$arch} = 1;
@@ -294,6 +293,7 @@
 
 plog('MSG', "check build bot results");
 
+my $pidfile = check_pid(\%run);
 my %later;
 foreach my $prefix (keys %pkg_tree) {
     my $ent = $pkg_tree{$prefix};
@@ -421,7 +421,7 @@
 	plog('INFO', "delete lock file for $prefix");
 	unlink $lock_file;
 
-	$run{bot}{$arch}{$host}{$bot} = 0;
+	$run{bot}{$host}{$bot} = 0;
 
 	if ($later) {
 	    next bot;
@@ -538,6 +538,7 @@
 
     } # end bot
 } # end prefix
+unlink $pidfile;
 
 
 #
@@ -625,7 +626,7 @@
 
 	foreach my $host (keys %{$config->{bot}{$arch}}) {
 	    foreach my $bot (keys %{$config->{bot}{$arch}{$host}}) {
-		next if $run{bot}{$arch}{$host}{$bot};
+		next if $run{bot}{$host}{$bot};
 
 		# Enable noarch lock after the first bot snarfs the package
 		#
@@ -633,7 +634,7 @@
 
 		plog('INFO', "building on $host/$arch ($bot)");
 
-		$run{bot}{$arch}{$host}{$bot} = $prefix;
+		$run{bot}{$host}{$bot} = $prefix;
 		$compildone->{$prefix}{$arch} = 1;
 
 		my $bot_conf = $config->{bot}{$arch}{$host}{$bot};
@@ -749,7 +750,6 @@
 
 
 #dump_cache(\%run);
-unlink $pidfile;
 exit();
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/mageia-sysadm/attachments/20110118/3f1088dd/attachment.html>


More information about the Mageia-sysadm mailing list