Skip to content

Commit

Permalink
Make s-f-resource propagate flux_respond_pack error
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 Aug 30, 2024
1 parent 26ac3c0 commit c3d821e
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;

Check warning on line 1018 in resource/modules/resource.cpp

View check run for this annotation

Codecov / codecov/patch

resource/modules/resource.cpp#L1017-L1018

Added lines #L1017 - L1018 were not covered by tests
}
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;

Check warning on line 1040 in resource/modules/resource.cpp

View check run for this annotation

Codecov / codecov/patch

resource/modules/resource.cpp#L1039-L1040

Added lines #L1039 - L1040 were not covered by tests
}

// Add msg as a subscriber to resource UP/DOWN updates
Expand Down

0 comments on commit c3d821e

Please sign in to comment.