Skip to content

Commit

Permalink
resource: call status disconnect handler
Browse files Browse the repository at this point in the history
Problem: when a client disconnects with a resource.status RPC
pending, the RPC is not aborted.

Change the resource module disconnect handler to allow non-owners
to send the message (and verify that the acquire handler is using
proper authentication).  Then call status_disconnect() from the
handler.
  • Loading branch information
garlick committed Mar 21, 2024
1 parent fa2b011 commit d1023a4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/modules/resource/resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ static void config_reload_cb (flux_t *h,
}

/* Handle client disconnect.
* Abort a streaming resource.acquire RPC, if it matches.
*/
static void disconnect_cb (flux_t *h,
flux_msg_handler_t *mh,
Expand All @@ -183,6 +182,8 @@ static void disconnect_cb (flux_t *h,

if (ctx->acquire)
acquire_disconnect (ctx->acquire, msg);
if (ctx->status)
status_disconnect (ctx->status, msg);
}

flux_t *resource_parent_handle_open (struct resource_ctx *ctx)
Expand Down Expand Up @@ -247,7 +248,7 @@ static const struct flux_msg_handler_spec htab[] = {
.typemask = FLUX_MSGTYPE_REQUEST,
.topic_glob = "resource.disconnect",
.cb = disconnect_cb,
.rolemask = 0
.rolemask = FLUX_ROLE_USER
},
FLUX_MSGHANDLER_TABLE_END,
};
Expand Down

0 comments on commit d1023a4

Please sign in to comment.