From ca65c6e6628aa6ebf3f2969a66802b4371d0dde4 Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Sun, 28 Apr 2024 18:10:41 -0700 Subject: [PATCH] qmanager/dfu: satisfiable but unreservable job support problem: jobs that are satisfiable but unreservable, in queues that use reservation, would fail with either a match failure or an EINVAL return from resource. This seems to only happen when `schedule` returns -1, an errno of ENOENT and the `at` value equal to the end of the graph. Solution: Rather than making that EINVAL, it now passes out EBUSY, which causes the new code for blocked constraints to pull the job out of pending and place it in blocked. To allow the job to proceed, we move blocked jobs back into the pending queue whenever a job is removed from the queue due to completion or cancellation. We probably consider them more than necessary, but this seems to solve the issue and still preserves the performance improvement. --- resource/traversers/dfu.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/resource/traversers/dfu.cpp b/resource/traversers/dfu.cpp index 061b6844b..968f8de1b 100644 --- a/resource/traversers/dfu.cpp +++ b/resource/traversers/dfu.cpp @@ -310,7 +310,14 @@ int dfu_traverser_t::run (Jobspec::Jobspec &jobspec, detail::dfu_impl_t::update (); } else if ( (rc = schedule (jobspec, meta, x, op, root, dfv)) == 0) { *at = meta.at; - if (*at < 0 or *at >= graph_end) { + if (*at == graph_end) { + detail::dfu_impl_t::reset_exclusive_resource_types + (exclusive_types); + // no schedulable point found even at the end of the time, return EBUSY + errno = EBUSY; + return -1; + } + if (*at < 0 or *at > graph_end) { detail::dfu_impl_t::reset_exclusive_resource_types (exclusive_types); errno = EINVAL;