Skip to content

Commit

Permalink
Merge pull request #14941 from mlschroe/master
Browse files Browse the repository at this point in the history
[backend] move cycle blocked setting into handlecycle
  • Loading branch information
mlschroe committed Sep 21, 2023
2 parents 81bcd30 + 0ba039b commit b49bd62
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
10 changes: 0 additions & 10 deletions src/backend/BSSched/BuildJob/Package.pm
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,6 @@ sub check {
my $incycle = $ctx->{'incycle'};
my @blocked = grep {$notready->{$dep2src->{$_}}} @$edeps;
@blocked = () if $repo->{'block'} && $repo->{'block'} eq 'never';
# check if cycle builds are in progress
if ($incycle == 3) {
push @blocked, 'cycle' unless @blocked;
if ($ctx->{'verbose'}) {
print " - $packid ($buildtype)\n";
print " blocked by cycle builds ($blocked[0]...)\n";
}
splice(@blocked, 10, scalar(@blocked), '...') if @blocked > 10;
return ('blocked', join(', ', @blocked));
}
# prune cycle packages from blocked
if ($incycle > 1) {
my $cyclevel = $ctx->{'cyclevel'};
Expand Down
10 changes: 7 additions & 3 deletions src/backend/BSSched/Checker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -952,8 +952,12 @@ sub handlecycle {
$packid = shift @$cpacks;
$cycpass->{$packid} = -2; # set pass2 endmarker
} elsif ($incycle == 3) {
unshift @$cpacks, @cycp;
$packid = shift @$cpacks;
my $notready = $ctx->{'notready'};
my $pkg2src = $ctx->{'pkg2src'} || {};
if (grep {$notready->{$pkg2src->{$_} || $_}} @cycp) {
$notready->{$pkg2src->{$_} || $_} ||= 1 for @cycp;
}
return (undef, 3);
}
return ($packid, $incycle);
}
Expand Down Expand Up @@ -1057,7 +1061,7 @@ sub checkpkgs {
my $incycle = 0;
if ($cychash{$packid}) {
($packid, $incycle) = handlecycle($ctx, $packid, \@cpacks, \%cycpass);
next if $packstatus{$packid} && $packstatus{$packid} ne 'done' && $packstatus{$packid} ne 'succeeded' && $packstatus{$packid} ne 'failed'; # already decided
next if !$packid || ($packstatus{$packid} && $packstatus{$packid} ne 'done' && $packstatus{$packid} ne 'succeeded' && $packstatus{$packid} ne 'failed'); # already decided
}
$ctx->{'incycle'} = $incycle;

Expand Down

0 comments on commit b49bd62

Please sign in to comment.