Skip to content

[9.1] feat: allow fractional MatchingDelay for sub-second matcher throttling - #8711

Merged
aldbr merged 2 commits into
DIRACGrid:integrationfrom
chrisburr:feat/fractional-matching-delay
Aug 4, 2026
Merged

[9.1] feat: allow fractional MatchingDelay for sub-second matcher throttling#8711
aldbr merged 2 commits into
DIRACGrid:integrationfrom
chrisburr:feat/fractional-matching-delay

Conversation

@chrisburr

Copy link
Copy Markdown
Member

MatchingDelay values were cast with int(), so the minimum spacing between matched jobs of a given type was 1 second per Matcher instance (>=1 job/s). Sites needing a higher steady start rate (e.g. to smooth a spiky batch of a few hundred jobs into a couple of hundred per two minutes) could not express the required sub-second spacing.

Parse the MatchingDelay path as float via a cast parameter on __extractCSData, so fractional seconds (e.g. 0.5) are honoured; DictCache already builds the TTL with timedelta(seconds=...), which accepts floats.

BEGINRELEASENOTES

*WorkloadManagement
NEW: allow fractional MatchingDelay for sub-second matcher throttling

ENDRELEASENOTES

@chrisburr
chrisburr force-pushed the feat/fractional-matching-delay branch 2 times, most recently from f74cfc3 to 137c4fc Compare July 16, 2026 08:41
@chrisburr
chrisburr marked this pull request as ready for review July 16, 2026 16:34
@chrisburr
chrisburr force-pushed the feat/fractional-matching-delay branch from 23237cb to 0ff974c Compare July 16, 2026 20:46
MatchingDelay values were cast with int(), so the minimum spacing between
matched jobs of a given type was 1 second (>=1 job/s). Sites needing a higher
steady start rate (e.g. to smooth a spiky batch of a few hundred jobs into a
couple of hundred per two minutes) could not express the required sub-second
spacing.

Parse the MatchingDelay path as float via a cast parameter on __extractCSData,
so fractional seconds (e.g. 0.5) are honoured; DictCache already builds the TTL
with timedelta(seconds=...), which accepts floats. RunningLimit continues to
parse as int.
The matching-delay counter was armed at the very end of Matcher.selectJob,
~7 DB round-trips after the negative condition was read. Under the Matcher's
concurrent request handling, every thread in that window reads the type as
un-delayed and matches it, so bursts of jobs slip past the delay (observed
~15-25% of matches landing <0.1s apart at a site with a 1s delay).

Move the arming to immediately after the match is confirmed Waiting, and reuse
the JobType already fetched for the status check so no extra query is added:
updateDelayCounters now accepts pre-fetched attributes and only queries the DB
for any configured attribute that is missing. This shrinks the read->arm window
from ~7 round-trips to the match itself, cutting the leak, and removes a query
from the match path.
@aldbr
aldbr force-pushed the feat/fractional-matching-delay branch from 0ff974c to 688e1c8 Compare August 4, 2026 13:39
@aldbr
aldbr merged commit 82ed15b into DIRACGrid:integration Aug 4, 2026
23 checks passed
@DIRACGridBot DIRACGridBot added the sweep:ignore Prevent sweeping from being ran for this PR label Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sweep:ignore Prevent sweeping from being ran for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants