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

[OSSTEST PATCH 27/60] sg-report-host-history: Write cache entry for unfinished jobs


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Date: Fri, 14 Aug 2020 18:21:32 +0100
  • Authentication-results: esa4.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:26:54 +0000
  • Ironport-sdr: ZM+qnAmamfS8aNtrEEM81CpDEcrPmI36jzG2YueP+r9+lJqBMkYcGDA64gvfd41lerJSmrHH1t +zDi/NW6mYv0DspCJq7gwWk+nNj5jh+TTYk2TY00ZSKcBqqaQghTgKijta7j1QRWvt0w+rJD54 5Q8cB9JMVbcEh0DqcqZJfXk9yXgqdJ39zrT/ZuGVqNp1/z4UP8FSKQDwoimP0DkfgiBe6QRLKp V3hmSTtp+Dg5byve+VY2YnUAlTX4+Pemy0m2kTxGejrfrD9v1OwZWy7VaxtYrYKI4FhB6A7W7/ nBE=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

We have to also check ->{finished}, rather than the existence of a row
at all, since now unfinished jobs can appear in the cache.

Because the cache key includes the job status, when the job becomes
finished the cache entry will be invalidated.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 sg-report-host-history | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sg-report-host-history b/sg-report-host-history
index 2ad2134d..6bf14aa2 100755
--- a/sg-report-host-history
+++ b/sg-report-host-history
@@ -214,7 +214,8 @@ END
        cache_row_lookup_prep(\$jr);
 
        my $endedrow = cacheable_query($endedq, $jr, 'e');
-       if (!$endedrow) {
+       if (!defined $endedrow->{finished}) {
+           cache_write_entry(\*H, $jr);
            #print DEBUG "no-finished\n";
            next;
        }
-- 
2.11.0




 


Rackspace

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