Sleep between deferred requests on paused handler

It looks like a launcher can busy loop and starve other threads from
running when a provider is at quota and a lot of requests are deferred.

Sleep 250ms between deferred requests to not hog the CPU.

Change-Id: I3dbf74ee2fe50308d1b5b286f091a052ec6c5ef9
This commit is contained in:
Simon Westphahl 2023-07-14 12:07:35 +02:00
parent 3fa6821437
commit e959b4efc1
No known key found for this signature in database

View File

@ -238,6 +238,7 @@ class PoolWorker(threading.Thread, stats.StatsReporter):
if self.paused_handlers and not reasons_to_decline:
self.log.debug("Handler is paused, deferring request")
time.sleep(0.25)
continue
# At this point, we are either unpaused, or we know we