@@ -333,6 +333,19 @@ def plug_produce_bqm(self, *, cbm: ABCCBMPropertyGraph, **kwargs) -> ABCBQMPrope
333333 site_sliver .capacity_allocations = site_sliver .capacity_allocations + allocated_caps
334334 worker_sliver .capacity_allocations = allocated_caps
335335
336+ # Warn when allocations exceed capacity
337+ w_cap = sliver .get_capacities () or Capacities ()
338+ if sliver .get_capacity_delegations () is not None :
339+ _ , dlg = sliver .get_capacity_delegations ().get_sole_delegation ()
340+ if dlg .get_format () == DelegationFormat .SinglePool :
341+ w_cap = dlg .get_details ()
342+ a_core = getattr (allocated_caps , 'core' , 0 ) or 0
343+ c_core = getattr (w_cap , 'core' , 0 ) or 0
344+ if a_core > c_core :
345+ self .logger .warning (
346+ f"Over-allocation detected on { sliver .get_name ()} at { sliver .site } : "
347+ f"cores_alloc={ a_core } > cores_cap={ c_core } " )
348+
336349 # get the location if available
337350 if loc is None :
338351 loc = sliver .get_location ()
@@ -799,6 +812,15 @@ def plug_produce_bqm_summary(self, *, cbm: ABCCBMPropertyGraph, **kwargs) -> dic
799812 w_ram_alloc = getattr (worker_allocs , 'ram' , 0 ) or 0
800813 w_disk_alloc = getattr (worker_allocs , 'disk' , 0 ) or 0
801814
815+ # Warn when allocations exceed capacity (indicates stale or
816+ # over-committed reservations on a host)
817+ if w_core_alloc > w_core_cap or w_ram_alloc > w_ram_cap or w_disk_alloc > w_disk_cap :
818+ self .logger .warning (
819+ f"Over-allocation detected on { sliver .get_name ()} at { s } : "
820+ f"cores={ w_core_alloc } /{ w_core_cap } "
821+ f"ram={ w_ram_alloc } /{ w_ram_cap } "
822+ f"disk={ w_disk_alloc } /{ w_disk_cap } " )
823+
802824 site_cores_cap += w_core_cap
803825 site_cores_alloc += w_core_alloc
804826 site_ram_cap += w_ram_cap
0 commit comments