All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Jackson <iwj@xenproject.org>
To: xen-devel@lists.xenproject.org
Cc: Ian Jackson <iwj@xenproject.org>
Subject: [OSSTEST PATCH 02/16] share in jobdb: Move out-of-flight special case higher up
Date: Thu, 22 Oct 2020 17:44:52 +0100	[thread overview]
Message-ID: <20201022164506.1552-3-iwj@xenproject.org> (raw)
In-Reply-To: <20201022164506.1552-1-iwj@xenproject.org>

This avoids running the runvar computation loop outside flights.
This is good amongst other things because that loop prints warnings
about undef $flight and $job.

Signed-off-by: Ian Jackson <iwj@xenproject.org>
---
 Osstest/JobDB/Executive.pm | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)

diff --git a/Osstest/JobDB/Executive.pm b/Osstest/JobDB/Executive.pm
index 071f31f1..4fa42e5d 100644
--- a/Osstest/JobDB/Executive.pm
+++ b/Osstest/JobDB/Executive.pm
@@ -587,6 +587,18 @@ END
 	$constraintsq->fetchrow_array() or confess "$hostname ?";
     };
 
+
+    if (!defined $flight) {
+	db_retry($dbh_tests,[], sub {
+	    $insertq->execute($hostname, $ttaskid,
+			      undef,undef,
+			      undef,
+			      undef,undef);
+	    $checkconstraints->();
+	});
+	return;
+    }
+
     my $ojvn = "$ho->{Ident}_lifecycle";
 
     if (length $r{$ojvn}) {
@@ -660,26 +672,17 @@ END
 	    }
 	}
 
-	if (defined $flight) {
-	    $insertq->execute($hostname, $ttaskid,
-			      $flight, $job,
-			      ($mode eq 'selectprep')+0,
+	$insertq->execute($hostname, $ttaskid,
+			  $flight, $job,
+			  ($mode eq 'selectprep')+0,
                 # ^ DBD::Pg doesn't accept perl canonical false for bool!
                 #   https://rt.cpan.org/Public/Bug/Display.html?id=133229
-			      $tident, $tstepno);
-	} else {
-	    $insertq->execute($hostname, $ttaskid,
-			      undef,undef,
-			      undef,
-			      undef,undef);
-	}
+			  $tident, $tstepno);
 	$checkconstraints->();
     });
 
-    if (defined $flight) {
-	push @lifecycle, $newsigil if length $newsigil;
-	store_runvar($ojvn, "@lifecycle");
-    }
+    push @lifecycle, $newsigil if length $newsigil;
+    store_runvar($ojvn, "@lifecycle");
 }
 
 sub current_stepno ($) { #method
-- 
2.20.1



  parent reply	other threads:[~2020-10-22 16:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-22 16:44 [OSSTEST PATCH 00/16] Bugfixes Ian Jackson
2020-10-22 16:44 ` [OSSTEST PATCH 01/16] share in jobdb: Break out $checkconstraints and move call Ian Jackson
2020-10-22 16:44 ` Ian Jackson [this message]
2020-10-22 16:44 ` [OSSTEST PATCH 03/16] PDU/IPMI: Retransmit, don't just wait Ian Jackson
2020-10-22 16:44 ` [OSSTEST PATCH 04/16] PDU/MSW: Warn that SNMP status is often not immediately updated Ian Jackson
2020-10-22 16:44 ` [OSSTEST PATCH 05/16] PDU/MSW: Break out get() Ian Jackson
2020-10-22 16:44 ` [OSSTEST PATCH 06/16] PDU/MSW: Break out action_value() Ian Jackson
2020-10-22 16:44 ` [OSSTEST PATCH 07/16] PDU/MSW: Actually implement delayed-* Ian Jackson
2020-10-22 16:44 ` [OSSTEST PATCH 08/16] PDU/MSW: Make show() return the value from get() Ian Jackson
2020-10-22 16:44 ` [OSSTEST PATCH 09/16] PDU/MSU: Retransmit on/off until PDU has changed Ian Jackson
2020-10-22 16:45 ` [OSSTEST PATCH 10/16] host reuse fixes: Fix running of steps adhoc Ian Jackson
2020-10-22 16:45 ` [OSSTEST PATCH 11/16] host reuse fixes: Fix runvar entry for adhoc tasks Ian Jackson
2020-10-22 16:45 ` [OSSTEST PATCH 12/16] Introduce guest_mk_lv_name Ian Jackson
2020-10-22 16:45 ` [OSSTEST PATCH 13/16] Prefix guest LV names with the job name Ian Jackson
2020-10-22 16:45 ` [OSSTEST PATCH 14/16] reporting: Minor fix to reporting of tasks with no subtask Ian Jackson
2020-10-22 16:45 ` [OSSTEST PATCH 15/16] host reuse fixes: Do not break host-reuse if no host allocated Ian Jackson
2020-10-22 16:45 ` [OSSTEST PATCH 16/16] starvation: Do not count more than half a flight as starved Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201022164506.1552-3-iwj@xenproject.org \
    --to=iwj@xenproject.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.