From 0c02518d1d64ad25f4994d5efc2d8abdea4bc696 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Wed, 30 Jul 2025 14:16:54 +0200 Subject: [PATCH] Handle locking correctly on throttle limit exceptions --- supervisor/jobs/decorator.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/supervisor/jobs/decorator.py b/supervisor/jobs/decorator.py index a3e100212..8f8b1064c 100644 --- a/supervisor/jobs/decorator.py +++ b/supervisor/jobs/decorator.py @@ -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():