Skip to content

Commit

Permalink
Merge pull request #5353 from grondo/issue#5345
Browse files Browse the repository at this point in the history
job-manager: prevent jobs with outstanding epilog-start events from becoming inactive
  • Loading branch information
mergify[bot] committed Jul 27, 2023
2 parents 522ff2c + 1ac8b4a commit 87bb7ee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/job-manager/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,9 @@ int event_job_action (struct event *event, struct job *job)
&& !job->alloc_pending
&& !job->free_pending
&& !job->start_pending
&& !job->has_resources) {
&& !job->has_resources
&& !job_event_is_queued (job, "epilog-start")
&& !job->perilog_active) {

if (event_job_post_pack (event, job, "clean", 0, NULL) < 0)
return -1;
Expand Down
10 changes: 10 additions & 0 deletions t/t2212-job-manager-plugins.t
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,16 @@ test_expect_success 'job-manager: epilog works after exception during prolog' '
n_free=$(lineno job.free perilog-exception-test.out) &&
test $n_epilog -lt $n_free
'
test_expect_success 'job-manager: epilog prevents clean event' '
flux jobtap load --remove=all ${PLUGINPATH}/perilog-test.so &&
jobid=$(flux submit --urgency=hold hostname) &&
flux cancel $jobid &&
flux job attach --wait-event clean -vE $jobid 2>&1 \
| tee perilog-epilog-clean-test.out &&
n_epilog=$(lineno job.epilog-finish perilog-epilog-clean-test.out) &&
n_clean=$(lineno job.clean perilog-epilog-clean-test.out) &&
test $n_epilog -lt $n_clean
'
test_expect_success 'job-manager: job.create posts events before validation' '
flux jobtap load --remove=all ${PLUGINPATH}/create-event.so &&
jobid=$(flux submit hostname) &&
Expand Down

0 comments on commit 87bb7ee

Please sign in to comment.