Handle locking correctly on throttle limit exceptions

This commit is contained in:
Stefan Agner 2025-07-30 14:16:54 +02:00
parent 0eba884fb1
commit 0c02518d1d
No known key found for this signature in database
GPG Key ID: AE01353D1E44747D

View File

@ -326,9 +326,13 @@ class Job(CoreSysAttributes):
# Handle execution limits
await self._handle_concurrency_control(job_group, job)
if not await self._handle_throttling(group_name):
try:
if not await self._handle_throttling(group_name):
self._release_concurrency_control(job_group)
return # Job was throttled, exit early
except Exception:
self._release_concurrency_control(job_group)
return # Job was throttled, exit early
raise
# Execute Job
with job.start():