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).
This commit is contained in:
Stefan Agner 2025-07-14 19:21:03 +02:00
parent 8932d88e69
commit f99e892f0e
No known key found for this signature in database
GPG Key ID: AE01353D1E44747D

View File

@ -148,17 +148,14 @@ class Job(CoreSysAttributes):
) )
self._rate_limited_calls = {} self._rate_limited_calls = {}
if self.throttle in ( if self.throttle is not None and self.concurrency in (
JobThrottle.GROUP_THROTTLE,
JobThrottle.GROUP_RATE_LIMIT,
) and self.concurrency in (
JobConcurrency.GROUP_REJECT, JobConcurrency.GROUP_REJECT,
JobConcurrency.GROUP_QUEUE, JobConcurrency.GROUP_QUEUE,
): ):
# We cannot release group locks when Job is not running (e.g. throttled) # We cannot release group locks when Job is not running (e.g. throttled)
# which makes these combinations impossible to use currently. # which makes these combinations impossible to use currently.
raise RuntimeError( 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 @property