Repository navigation
Use the parent FIFO generation for nested task priority - #9425
Open
ApacheWang wants to merge 1 commit into
Open
ApacheWang wants to merge 1 commit into
ApacheWang wants to merge 1 commit into
Conversation
Signed-off-by: bc15575202581 <bc15575202581@gmail.com>
Contributor
Unit Test ResultsSee test report for an extended history of previous test failures. This is useful for diagnosing flaky tests. 48 files ± 0 48 suites ±0 15h 59m 17s ⏱️ - 17m 32s For more details on these failures, see this check. Results for commit c02a6f7. ± Comparison against base commit ddc7515. |
This branch has not been deployed
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.
Summary
Fixes
Scheduler._set_prioritiesindistributed/scheduler.pyto derive nested task FIFO generation from the parent task's generation (sts.priority[1]) instead of its negated user priority (sts.priority[0]).Root Cause
Task priorities are assigned as
(-annotated_prio, generation, internal_priority[ts.key])(distributed/scheduler.py:5354). When a task submits nested sub-tasks,_set_prioritiescomputed:Because index
0holds-annotated_priorather thangeneration:user_priority=-10), a parent at generation2gave its nested sub-task generation9.99, sorting the sub-task behind its parent and behind newer unrelated tasks (generation=3).0, a parent at generation2gave its nested sub-task generation-0.01, jumping ahead of older unrelated tasks (generation=1) instead of staying just before its parent (1.99).Fix
Read the parent's FIFO generation from
sts.priority[1]:Verification
RED (on
origin/mainwithtest_nested_submission_fifo_priority): failed because nested task received priority(10, 9.99, 0), sorting afterparent(10, 2, 0)andnewer(10, 3, 0).GREEN (with fix):
distributed/tests/test_scheduler.py::test_nested_submission_fifo_prioritypasses; broader offline scheduler tests pass (261 passed).ruff checkandruff format --checkpass on both modified files.Tests added / passed
Passes lint (
ruff check&ruff format --check)