diff --git a/src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py b/src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py index dfa3273bd1d..bb54f35b4d4 100644 --- a/src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py +++ b/src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py @@ -423,10 +423,12 @@ def _getNumberOfJobsNeedingPilots(self, waitingPilots: int, queue: str): return 0 taskQueueDict = result["Value"] - # Get the number of jobs that would match the capability of the CE + # Get the number of jobs that would match the capability of the CE and the VO waitingSupportedJobs = 0 for tq in taskQueueDict.values(): - waitingSupportedJobs += tq["Jobs"] + ownerGroup = tq.get("OwnerGroup", "") + if Registry.getVOForGroup(ownerGroup) == self.vo: + waitingSupportedJobs += tq["Jobs"] # Get the number of jobs that need pilots return max(0, waitingSupportedJobs - waitingPilots)