fix: back off scheduler lock retries

This commit is contained in:
lda
2026-09-10 02:16:24 +07:00 Verified
parent 811df00be9
commit 6bc01ae8ff
+4 -1
View File
@@ -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