[PATCH 2/2] testbot: Purge old jobs based on their Submitted timestamp.

Francois Gouget fgouget at codeweavers.com
Wed Jan 17 20:58:32 CST 2018

Although it would only happen in case of a major TestBot malfunction,
a Job could end up in a state where it will never complete and thus
where its Ended field never gets set. So deleting old jobs based on
their Ended field could leave us with zombies.
This cannot happen with the Submitted timestamp since that field is not
Also, a Job run time is normally very small compared to the expiration
time (under a couple of hours compared to several days) so this does not
make a significant difference in when a job actually gets deleted.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>

I did get a Job zombie once on my local TestBot but it was due to bugs 
in the TestBot code (those did not make it to the production server 
fortunately). Sill, better safe than sorry.

 testbot/bin/Janitor.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testbot/bin/Janitor.pl b/testbot/bin/Janitor.pl
index 6ac22ded..0f126e87 100755
--- a/testbot/bin/Janitor.pl
+++ b/testbot/bin/Janitor.pl
@@ -61,7 +61,7 @@ if ($JobPurgeDays != 0)
   my $Jobs = CreateJobs();
   foreach my $Job (@{$Jobs->GetItems()})
-    if (defined($Job->Ended) && $Job->Ended < $DeleteBefore)
+    if ($Job->Submitted < $DeleteBefore)
       LogMsg "Deleting job ", $Job->Id, "\n";

More information about the wine-devel mailing list