fix: back off scheduler lock retries
This commit is contained in:
@@ -516,7 +516,10 @@ class SchedulerService:
|
|||||||
cancelled = False
|
cancelled = False
|
||||||
while not self._lock.acquire(blocking=False):
|
while not self._lock.acquire(blocking=False):
|
||||||
try:
|
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:
|
except asyncio.CancelledError:
|
||||||
if not continue_after_cancel:
|
if not continue_after_cancel:
|
||||||
raise
|
raise
|
||||||
|
|||||||
Reference in New Issue
Block a user