From 145667cb53aebac706eef7b50e42d366b72f53ac Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sat, 19 Mar 2022 22:43:19 -0400 Subject: [PATCH] hydra-update-gc-roots: allow cached refs to the build's jobset Re-executing this search_related on every access turned out to create very problematic performance. If a jobset had a lot of error output stored in the jobset, and there were many hundreds or thousands of active jobs, this could easily cause >1Gbps of network traffic. --- src/script/hydra-update-gc-roots | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/script/hydra-update-gc-roots b/src/script/hydra-update-gc-roots index fbb90488..f446cdf9 100755 --- a/src/script/hydra-update-gc-roots +++ b/src/script/hydra-update-gc-roots @@ -39,10 +39,7 @@ sub keepBuild { $build->finished; - # After #1093 merges this can become $build->jobset; - # However, with ->jobset being a column on master - # it seems DBIX gets a bit confused. - my ($jobset) = $build->search_related('jobset')->first; + my ($jobset) = $build->jobset; print STDERR " keeping ", ($build->finished ? "" : "scheduled "), "build ", $build->id, " (", $jobset->get_column('project'), ":", $jobset->get_column('name'), ":", $build->get_column('job'), "; ",