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

Prevent allocation of currently allocated resources #1046

Merged
merged 2 commits into from
Jul 11, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions resource/traversers/dfu_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,17 @@ int dfu_impl_t::by_excl (const jobmeta_t &meta, const std::string &s, vtx_t u,
// requested, we check the validity of the visiting vertex using
// its x_checker planner.
if (exclusive_in || resource.exclusive == Jobspec::tristate_t::TRUE) {
// If it's exclusive, the traversal type is an allocation, and
// there are no other allocations on the vertex, then proceed. This
// check prevents the observed multiple booking issue, where
// resources with jobs running beyond their walltime can be
// allocated to another job since the planner considers them
// available. Note: if Fluxion needs to support shared
// resources at the leaf level this check will not catch
// multiple booking.
if (meta.alloc_type == jobmeta_t::alloc_type_t::AT_ALLOC &&
!(*m_graph)[u].schedule.allocations.empty ())
goto done;
errno = 0;
p = (*m_graph)[u].idata.x_checker;
njobs = planner_avail_resources_during (p, at, duration);
Expand Down
4 changes: 2 additions & 2 deletions t/t1024-alloc-check.t
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ test_expect_success 'submit node-exclusive jobs that exceed their time limit' '
test_expect_success 'some jobs received timeout exception' '
grep "job.exception type=timeout" joberr
'
test_expect_failure 'no jobs received alloc-check exception' '
test_expect_success 'no jobs received alloc-check exception' '
test_must_fail grep "job.exception type=alloc-check" joberr
'
test_expect_success 'clean up' '
Expand All @@ -57,7 +57,7 @@ test_expect_success 'submit non-exclusive jobs that exceed their time limit' '
test_expect_success 'some jobs received timeout exception' '
grep "job.exception type=timeout" joberr2
'
test_expect_failure 'no jobs received alloc-check exception' '
test_expect_success 'no jobs received alloc-check exception' '
test_must_fail grep "job.exception type=alloc-check" joberr2
'
test_expect_success 'clean up' '
Expand Down
Loading