From d785222102b7ca1ecc7c03b82745303fdb3d544a Mon Sep 17 00:00:00 2001 From: jacobtkeio Date: Fri, 30 Aug 2024 11:16:49 -0700 Subject: [PATCH] Make s-f-resource propagate flux_respond_pack err Problem: If notify_request_cb fails flux_respond_pack, it responds with nothing, leaving feasibility without resources but active. Make notify_request_cb send a flux_respond_error on a flux_respond_pack_error. --- resource/modules/resource.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/resource/modules/resource.cpp b/resource/modules/resource.cpp index 4bcdf0c7c..1b4e76221 100644 --- a/resource/modules/resource.cpp +++ b/resource/modules/resource.cpp @@ -1017,6 +1017,12 @@ static void notify_request_cb (flux_t *h, flux_msg_handler_t *w, const flux_msg_ flux_log_error (h, "%s: flux_msg_route_first", __FUNCTION__); goto error; } + if (ctx->opts.get_opt ().is_load_file_set ()) { + errno = ENODATA; + // Since m_acquired_resources is null, + flux_log_error (ctx->h, "%s: cannot notify when load-file set", __FUNCTION__); + goto error; + } // Respond only after sched-fluxion-resource gets // resources from its resource.acquire RPC. @@ -1031,6 +1037,7 @@ static void notify_request_cb (flux_t *h, flux_msg_handler_t *w, const flux_msg_ ctx->m_acquired_resources_expiration) < 0) { flux_log_error (ctx->h, "%s: flux_respond_pack", __FUNCTION__); + goto error; } // Add msg as a subscriber to resource UP/DOWN updates