scheduler: only schedule jobs on state transitions#3121
Open
nuclearcat wants to merge 1 commit into
Open
Conversation
get_configs() matched a scheduler entry whenever the current event values satisfied it (level-triggered). Because a node event is emitted on every update, any update that left the node in an already-matching state (an artifact, timeout or flag change on an "available" node) re-triggered creation of the whole set of child jobs. A 6-month audit of production confirmed this happens routinely: across 26 sampled days (236,139 job nodes) there were 4,380 duplicate job groups -- identical parent/name/runtime/platform with the same retry_counter, created seconds apart -- with the rate rising sharply from late April 2026, reaching ~10% of jobs on some days. Make scheduling edge-triggered: fire only on the transition into the matched condition, using previous_state/previous_result now carried in the event. Falls back to the previous level-triggered behaviour when that information is absent (node creation, retry events, older API), so retries and freshly created nodes are unaffected. Fixes kernelci#2912 Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
get_configs() matched a scheduler entry whenever the current event values satisfied it (level-triggered). Because a node event is emitted on every update, any update that left the node in an already-matching state (an artifact, timeout or flag change on an "available" node) re-triggered creation of the whole set of child jobs.
A 6-month audit of production confirmed this happens routinely: across 26 sampled days (236,139 job nodes) there were 4,380 duplicate job groups -- identical parent/name/runtime/platform with the same retry_counter, created seconds apart -- with the rate rising sharply from late April 2026, reaching ~10% of jobs on some days.
Make scheduling edge-triggered: fire only on the transition into the matched condition, using previous_state/previous_result now carried in the event. Falls back to the previous level-triggered behaviour when that information is absent (node creation, retry events, older API), so retries and freshly created nodes are unaffected.
Fixes #2912