Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

job-manager: fix for job priority not reset after a duplicate urgency update #4941

Merged
merged 2 commits into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/modules/job-manager/prioritize.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,14 @@ static int reprioritize_one (struct job_manager *ctx,
else if (job->urgency == FLUX_JOB_URGENCY_EXPEDITE)
priority = FLUX_JOB_PRIORITY_MAX;

/* If priority did not change, then do not post a priority
* event, reorder queues, etc. (a change of priority to the
* current value is not an "event")
/*
* If priority did not change, _and_ the job is in SCHED state,
* then do not post a priority event, since this would be useless
* noise in the eventlog. However, be sure to post a priority event
* in PRIORITY state, since this is what transitions a job to the
* SCHED state.
*/
if (priority == job->priority)
if (priority == job->priority && job->state == FLUX_JOB_STATE_SCHED)
return 0;

/* Priority event is only posted to job eventlog in
Expand Down
7 changes: 7 additions & 0 deletions t/t2213-job-manager-hold-single.t
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ test_expect_success HAVE_JQ 'job-manager: annotations job 5 pending (job 2/4 hel
jmgr_check_annotation $(cat job5.id) "sched.reason_pending" "\"insufficient resources\""
'

test_expect_success HAVE_JQ 'job-manager: job 2, 4 hold again (issue #4940)' '
flux job urgency $(cat job2.id) hold &&
flux job urgency $(cat job4.id) hold &&
jmgr_check_state $(cat job2.id) S &&
jmgr_check_state $(cat job4.id) S
'

test_expect_success 'job-manager: job 4 release (higher urgency)' '
flux job urgency $(cat job4.id) 20
'
Expand Down
8 changes: 8 additions & 0 deletions t/t2214-job-manager-hold-limited.t
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ test_expect_success HAVE_JQ 'job-manager: job annotations correct (RSSSS)' '
jmgr_check_no_annotations $(cat job5.id)
'

test_expect_success 'job-manager: hold job 3, 5 again (issue #4940)' '
flux job urgency $(cat job3.id) hold &&
flux job urgency $(cat job3.id) hold &&
flux job urgency $(cat job3.id) hold &&
flux job urgency $(cat job3.id) hold &&
flux job urgency $(cat job5.id) hold
'

test_expect_success 'job-manager: remove hold on job 3, 4, 5' '
flux job urgency $(cat job3.id) 16 &&
flux job urgency $(cat job4.id) 16 &&
Expand Down
4 changes: 4 additions & 0 deletions t/t2215-job-manager-hold-unlimited.t
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ test_expect_success 'job-manager: put hold on job 3' '
flux job urgency $(cat job3.id) hold
'

test_expect_success 'job-manager: hold job 4 again (issue #4940)' '
flux job urgency $(cat job4.id) hold
'

test_expect_success HAVE_JQ 'job-manager: job state RRSSS' '
jmgr_check_state $(cat job1.id) R &&
jmgr_check_state $(cat job2.id) R &&
Expand Down