diff --git a/src/backend/bs_repserver b/src/backend/bs_repserver index 6eac2a1d74c..33f9ee375e0 100755 --- a/src/backend/bs_repserver +++ b/src/backend/bs_repserver @@ -69,6 +69,7 @@ use BSSched::ProjPacks; use BSRepServer; use BSRepServer::BuildInfo; use BSDispatcher::Constraints; +use BSCando; use Build; use strict; @@ -3584,6 +3585,17 @@ sub checkconstraints { my $prjconfconstraint = BSDispatcher::Constraints::list2struct($BSXML::constraints, \@list); $constraints = $constraints ? BSDispatcher::Constraints::mergeconstraints($prjconfconstraint, $constraints) : $prjconfconstraint; + my %harchcando; # can the harch build an arch? + for my $harch (keys %BSCando::cando) { + for my $arch (@{$BSCando::cando{$harch}}) { + if ($arch =~ /^([^:]+):(.+)$/) { + $harchcando{"$harch/$1"} = $2; + } else { + $harchcando{"$harch/$arch"} = ''; + } + } + } + my $dispatch_constraints_info = { 'project' => $projid , 'repoid' => $repoid, @@ -3595,6 +3607,8 @@ sub checkconstraints { for my $workerstate (qw{idle building away dead down}) { my @workernames = sort(grep {!/^\./} BSUtil::ls("$workersdir/$workerstate")); for my $workername (@workernames) { + my ($harch) = split(':', $workername, 2); + next unless exists($harchcando{"$harch/$arch"}); my $worker = readxml("$workersdir/$workerstate/$workername", $BSXML::worker, 1); next if $BSConfig::dispatch_constraint && !$BSConfig::dispatch_constraint->($dispatch_constraints_info, $worker, $constraints); next if $constraints && BSDispatcher::Constraints::oracle($worker, $constraints) <= 0; diff --git a/src/backend/bs_srcserver b/src/backend/bs_srcserver index 0e9151f8b64..136b8cca317 100755 --- a/src/backend/bs_srcserver +++ b/src/backend/bs_srcserver @@ -5695,15 +5695,14 @@ sub hello { #################################################################### sub getworkercap { - my ($cgi) = @_; + my ($cgi, $workerid) = @_; my $reposerver = $BSConfig::masterdispatcher || $BSConfig::reposerver; # no need to look for partitioning here - my @args = BSRPC::args($cgi, 'workerid'); my $param = { - 'uri' => "$reposerver/getworkercapabilities", + 'uri' => "$reposerver/worker/$workerid", 'timeout' => 60, }; - my $worker_cap = BSWatcher::rpc($param, $BSXML::worker, @args); + my $worker_cap = BSWatcher::rpc($param, $BSXML::worker); return($worker_cap, $BSXML::worker); }