From 79964fd405022002f2a852003f1c5a521cbba9d5 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Mon, 14 Jul 2025 19:21:03 +0200 Subject: [PATCH] Prevent using any throttling with group concurrency The group concurrency modes (reject and queue) are not compatible with any throttling, since we currently can't unlock the group lock when a job doesn't get started (which is the case when throttling is applied). --- supervisor/jobs/decorator.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/supervisor/jobs/decorator.py b/supervisor/jobs/decorator.py index bef6b89f5..44a97a5c6 100644 --- a/supervisor/jobs/decorator.py +++ b/supervisor/jobs/decorator.py @@ -148,17 +148,14 @@ class Job(CoreSysAttributes): ) self._rate_limited_calls = {} - if self.throttle in ( - JobThrottle.GROUP_THROTTLE, - JobThrottle.GROUP_RATE_LIMIT, - ) and self.concurrency in ( + if self.throttle is not None and self.concurrency in ( JobConcurrency.GROUP_REJECT, JobConcurrency.GROUP_QUEUE, ): # We cannot release group locks when Job is not running (e.g. throttled) # which makes these combinations impossible to use currently. raise RuntimeError( - f"Job {self.name} is using group throttling ({self.throttle}) with group concurrency ({self.concurrency}), which is not allowed!" + f"Job {self.name} is using throttling ({self.throttle}) with group concurrency ({self.concurrency}), which is not allowed!" ) @property