Skip to content

Commit

Permalink
[backend] be more verbose about project/repo error states
Browse files Browse the repository at this point in the history
Makes debugging interconnect issues a bit easier.
  • Loading branch information
mlschroe committed Jun 4, 2018
1 parent ac9c3eb commit 7edc585
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/backend/BSSched/Remote.pm
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,7 @@ sub remotemap2remoteprojs {
undef $oproj if $oproj && ($oproj->{'remoteurl'} ne $proj->{'remoteurl'} || $oproj->{'remoteproject'} ne $proj->{'remoteproject'});
my $c = $proj->{'config'};
$c = $oproj->{'config'} if !defined($c) && $oproj;
my $error = $proj->{'error'};
delete $proj->{'error'};
my $error = delete $proj->{'error'};
$proj = $oproj if $proj->{'proto'} && $oproj && !$oproj->{'proto'};
delete $proj->{'config'};
$proj->{'config'} = $c if defined $c;
Expand Down Expand Up @@ -353,8 +352,11 @@ sub addrepo_remote {
my ($ctx, $pool, $prp, $arch, $remoteproj) = @_;

my ($projid, $repoid) = split('/', $prp, 2);
return undef if !$remoteproj || $remoteproj->{'error'};

return undef unless $remoteproj;
if ($remoteproj->{'error'}) {
print " remote project $prp/$arch: $remoteproj->{'error'}\n";
return undef;
}
my $gctx = $ctx->{'gctx'};
print " fetching remote repository state for $prp\n";
my $param = {
Expand Down Expand Up @@ -493,7 +495,10 @@ sub read_gbininfo_remote {
my ($ctx, $prpa, $remoteproj, $packstatus) = @_;

return undef unless $remoteproj;
return undef if $remoteproj->{'error'};
if ($remoteproj->{'error'}) {
print " remote project $prpa: $remoteproj->{'error'}\n";
return undef;
}

my $gctx = $ctx->{'gctx'};
my $remotegbininfos = $gctx->{'remotegbininfos'};
Expand All @@ -504,6 +509,7 @@ sub read_gbininfo_remote {

# first check error case
if ($remotegbininfos->{$prpa} && $remotegbininfos->{$prpa}->{'error'} && ($remotegbininfos->{$prpa}->{'lastfetch'} || 0) > $now - 3600) {
print " remote project binary state for $prpa: $remotegbininfos->{$prpa}->{'error'}\n";
return undef;
}

Expand Down

0 comments on commit 7edc585

Please sign in to comment.