Skip to content

Commit

Permalink
[v1.18.x] fabtests/rdm_tagged_peek: fix race condition synchronization
Browse files Browse the repository at this point in the history
It was possible for the client to complete the finalize send before
the server gets the last 0xabc completion, causing a tag mismatch
when processing the incorrect receive.

This removes the extra synchronization sends and adds an OOB sync to
make sure all of the test sends have finished before quitting the test.

Signed-off-by: Alexia Ingerson <[email protected]>
(cherry picked from commit 09ca779)
  • Loading branch information
aingerson authored and j-xiong committed Nov 16, 2023
1 parent c9eab77 commit ceba5d0
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions fabtests/functional/rdm_tagged_peek.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,34 +309,13 @@ static int run(void)
ret = do_recvs();
if (ret)
return ret;

/* sync with sender before ft_finalize, since we sent
* and received messages outside of the sequence numbers
* maintained by common code */
do {
ret = fi_tsend(ep, tx_buf, 1, mr_desc,
remote_fi_addr, 0xabc,
&tx_ctx_arr[0].context);
} while (ret == -FI_EAGAIN);
if (ret)
return ret;

ret = wait_for_send_comp(1);
if (ret)
return ret;
} else {
ret = do_sends();
if (ret)
return ret;

ret = trecv_op(0xabc, 0, false);
if (ret) {
FT_PRINTERR("Receive sync", ret);
return ret;
}
}

ft_finalize();
ft_sync();
return 0;
}

Expand All @@ -345,7 +324,7 @@ int main(int argc, char **argv)
int ret, op;

opts = INIT_OPTS;
opts.options |= FT_OPT_SIZE;
opts.options |= FT_OPT_SIZE | FT_OPT_OOB_SYNC;
opts.transfer_size = 64; /* Don't expect receiver buffering */
opts.window_size = SEND_CNT;

Expand Down

0 comments on commit ceba5d0

Please sign in to comment.