Skip to content

Commit

Permalink
Make s-f-resource propagate flux_respond_pack err
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jacobtkeio committed Oct 12, 2024
1 parent c9df833 commit d785222
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions resource/modules/resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit d785222

Please sign in to comment.