fix: back off scheduler lock retries
This commit is contained in:
@@ -516,7 +516,10 @@ class SchedulerService:
|
||||
cancelled = False
|
||||
while not self._lock.acquire(blocking=False):
|
||||
try:
|
||||
await asyncio.sleep(0)
|
||||
# The poll worker may hold this lock during file I/O. A
|
||||
# nonzero delay avoids busy-spinning the event loop while
|
||||
# still allowing registration and stop callbacks to run.
|
||||
await asyncio.sleep(0.001)
|
||||
except asyncio.CancelledError:
|
||||
if not continue_after_cancel:
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user