[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OSSTEST PATCH 34/60] sg-report-job-history: Use one child per report


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Date: Fri, 14 Aug 2020 18:21:39 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Delivery-date: Fri, 14 Aug 2020 17:22:50 +0000
  • Ironport-sdr: 6ARKZM0gZtes4QSkjJYnK72EiWwb9mWVaqcYBhEIBbYXHm0QFvsTcppTGOls0TmEKKm2deWvsY ZgX6WQW0r2Hl77IPdYgblLsKlMfT/vZExgBVdEiEpWme5NskbP2zT0e0at+7y79lLLKavJmuSD 1D7Qqc7uG2I35bv5r72TKpNDq+7JezrRpeBNylQGm+MYuqGGQZxjW7fES0TYjlVW4ClYglW3AB T8abbixo/T81ZtDTd1i5sF13vAUiNwku12qePAXTIiH2L+qiH3twMe9N4WZ9KMHx18TO14stP3 +ZQ=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Rather than one child per job, which then did one report per branch.

This will mean we can use the cache machinery, which is rather global
so wouldn't cope well with processing multiple job history reports
within a process.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 sg-report-job-history | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/sg-report-job-history b/sg-report-job-history
index 384a7670..3307b281 100755
--- a/sg-report-job-history
+++ b/sg-report-job-history
@@ -296,15 +296,16 @@ END
     }
 }
 
-sub processjob ($) {
-    my ($j) = @_;
-    processjobbranch($j,undef);
-    processjobbranch($j,$_) foreach @branches;
+my @tasks;
+foreach my $j (@jobs) {
+    push @tasks, $j;
+    push @tasks, "$j $_" foreach @branches;
 }
 
-parallel_by_fork('sg-report-job-history', $maxjobs, \@jobs, sub {
-    my ($j) = @_;
+parallel_by_fork('sg-report-job-history', $maxjobs, \@tasks, sub {
+    my ($task) = @_;
+    my ($job, $branch) = split / /, $task; # $branch might be undef
     db_retry($dbh_tests, [], sub {
-        processjob($j);
+        processjobbranch($job, $branch);
     });
 });
-- 
2.11.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.