Skip to content

Commit

Permalink
track raw RPC API changes in core
Browse files Browse the repository at this point in the history
Problem: the raw RPC interfaces are changing to use a size_t
instead of int for payload size.

Update dyad usage.

flux-framework/flux-core#6467 must be merged before this will pass CI.
  • Loading branch information
garlick committed Dec 10, 2024
1 parent 6c1ef22 commit dd04bff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/dyad/dtl/flux_dtl.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ dyad_rc_t dyad_dtl_flux_send (const dyad_ctx_t* ctx, void* buf, size_t buflen)
rc = flux_respond_raw (ctx->dtl_handle->private_dtl.flux_dtl_handle->h,
ctx->dtl_handle->private_dtl.flux_dtl_handle->msg,
buf,
(int)buflen);
buflen);
if (FLUX_IS_ERROR (rc)) {
DYAD_LOG_ERROR (ctx,
"Could not send Flux RPC response containing file "
Expand Down Expand Up @@ -196,8 +196,8 @@ dyad_rc_t dyad_dtl_flux_recv (const dyad_ctx_t* ctx, void** buf, size_t* buflen)
goto finish_recv;
}
void* tmp_buf;
int tmp_buflen = 0;
rc = flux_rpc_get_raw (dtl_handle->f, (const void**)&tmp_buf, (int*)&tmp_buflen);
size_t tmp_buflen = 0;
rc = flux_rpc_get_raw (dtl_handle->f, (const void**)&tmp_buf, &tmp_buflen);
if (FLUX_IS_ERROR (rc)) {
DYAD_LOG_ERROR (ctx, "Could not get file data from Flux RPC");
if (errno == ENODATA)
Expand All @@ -206,7 +206,7 @@ dyad_rc_t dyad_dtl_flux_recv (const dyad_ctx_t* ctx, void** buf, size_t* buflen)
dyad_rc = DYAD_RC_BADRPC;
goto finish_recv;
}
*buflen = (size_t) tmp_buflen;
*buflen = tmp_buflen;
dyad_rc = ctx->dtl_handle->get_buffer (ctx, *buflen, buf);
if (DYAD_IS_ERROR (dyad_rc)) {
*buf = NULL;
Expand Down
6 changes: 3 additions & 3 deletions tests/modules/compute.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ int main (int argc, char **argv)

// Extract the data from reply
const char *file_data = NULL;
int file_len = 0;
size_t file_len = 0;
if (flux_rpc_get_raw (f2, (const void **)&file_data, &file_len) < 0) {
flux_log_error (h, "flux_rpc_get_raw(\"%s\") failed.\n", file_name);
goto done;
}
fprintf (df, "Consumer file size: %d\n", file_len);
fprintf (df, "Consumer file size: %zu\n", file_len);

// Set output file path
char file_path[PATH_MAX + 1] = {'\0'};
Expand All @@ -167,7 +167,7 @@ int main (int argc, char **argv)
fprintf (df, "Could not write file: %s\n", file_path);
goto done;
}
fwrite (file_data, sizeof (char), (size_t)file_len, of);
fwrite (file_data, sizeof (char), file_len, of);
fclose (of);

flux_future_destroy (f2);
Expand Down

0 comments on commit dd04bff

Please sign in to comment.