@ -121,7 +121,7 @@ class PoolWorker(threading.Thread, stats.StatsReporter):
# become out of date as the loop progresses, but it should be
# good enough to determine whether we should process requests
# which express a preference for a specific provider.
launcher s = self . zk . getRegisteredPools ( )
launcher _pool s = self . zk . getRegisteredPools ( )
pm = self . getProviderManager ( )
has_quota_support = isinstance ( pm , QuotaSupport )
@ -180,8 +180,8 @@ class PoolWorker(threading.Thread, stats.StatsReporter):
log = get_annotated_logger ( self . log , event_id = req . event_id ,
node_request_id = req . id )
# Get the candidate launchers for these nodes
candidate_launcher s = set (
x for x in launcher s
candidate_launcher _pool s = set (
x for x in launcher _pool s
if ( set ( x . supported_labels ) . issuperset ( set ( req . node_types ) ) and
x . id not in req . declined_by )
)
@ -189,26 +189,26 @@ class PoolWorker(threading.Thread, stats.StatsReporter):
# which is online
if req . provider and req . provider != self . provider_name :
# The request is asking for a specific provider
launcher_ ids_for_provider = set (
x . id for x in candidate_launcher s
launcher_ pool_ ids_for_provider = set (
x . id for x in candidate_launcher _pool s
if x . provider_name == req . provider
)
if launcher_ ids_for_provider:
if launcher_ pool_ ids_for_provider:
# There is a launcher online which can satisfy the
# request that has not yet declined the request,
# so yield to it.
log . debug ( " Yielding request to provider %s %s " ,
req . provider , launcher_ ids_for_provider)
req . provider , launcher_ pool_ ids_for_provider)
continue
priority = self . getPriority ( )
launcher_ ids_with_higher_priority = set (
x . id for x in candidate_launcher s
launcher_ pool_ ids_with_higher_priority = set (
x . id for x in candidate_launcher _pool s
if x . priority < priority and not x . paused
)
if launcher_ ids_with_higher_priority:
if launcher_ pool_ ids_with_higher_priority:
log . debug ( " Yielding request to higher priority providers %s " ,
launcher_ ids_with_higher_priority)
launcher_ pool_ ids_with_higher_priority)
continue
if has_quota_support and not all ( label_quota . get ( l , math . inf ) > 0