Skip to content

Commit

Permalink
fabtests: Syncronize on Initialization
Browse files Browse the repository at this point in the history
fabtests/functional: Add manual init sync to fi_rdm_multiclient and fi_rdm

Some providers (verbs ud) might require the server to be fully initialized
before the client process calls getinfo with the server address.
This causes a No Data Available error due to the fi_info call failing during
initialization by not being able to find the name on the server.
This is seen most often in cases where a socket (usually oob [out of band]) is
initialized before getinfo in the ft_init_fabric sequence. Adding a sync only
if an oob socket has been initialized to order the initialization correctly will
prevent this from happening.

The syncronization is for client to start getinfo only after the server is done
initializing everything.

fi_rdm_multiclient test needs its client startup to have a manual sync since it
does not follow the normal codepath of going through ft_init_fabric like the server
and other tests do. This sync will only happen on the first client that connects
because it is only necessary to give the server enough time to spin up all the
resources. It is not necessary for future clients because the server has already
started all of those resources.

fi_rdm needs the syncronization added after accepting a new client because the
client will be waiting for a sock_send and the server only does it once on its
initialization. Adding a ft_sock_sync will force the server to do it for each
new client.

Signed-off-by: Zach Dworkin <zachary.dworkin@intel.com>
  • Loading branch information
zachdworkin committed Jun 24, 2024
1 parent 4c90c24 commit bac8244
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
18 changes: 17 additions & 1 deletion fabtests/common/shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,11 @@ int ft_accept_next_client() {
ret = ft_reset_oob();
if (ret)
return ret;
}

ret = ft_sock_sync(oob_sock, 0);
if (ret)
return ret;
}
return ft_init_av();
}

Expand Down Expand Up @@ -1305,6 +1309,12 @@ int ft_init_fabric(void)
if (ret)
return ret;

if (oob_sock >= 0 && opts.dst_addr) {
ret = ft_sock_sync(oob_sock, 0);
if (ret)
return ret;
}

ret = ft_getinfo(hints, &fi);
if (ret)
return ret;
Expand All @@ -1321,6 +1331,12 @@ int ft_init_fabric(void)
if (ret)
return ret;

if (oob_sock >= 0 && !opts.dst_addr) {
ret = ft_sock_sync(oob_sock, 0);
if (ret)
return ret;
}

ret = ft_init_av();
if (ret)
return ret;
Expand Down
4 changes: 4 additions & 0 deletions fabtests/functional/rdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,13 @@ static int run(void)

while (nconn && !ret) {
ret = ft_send_recv_greeting(ep);
if (ret)
return ret;

if (--nconn && !ret) {
ret = ft_accept_next_client();
if (ret)
return ret;
}
}

Expand Down
6 changes: 6 additions & 0 deletions fabtests/functional/rdm_multi_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ static int run_client(int client_id, bool address_reuse)
return ret;
}

if (!client_id && oob_sock >= 0) {
ret = ft_sock_sync(oob_sock, 0);
if (ret)
return ret;
}

ret = ft_getinfo(hints, &fi);
if (ret) {
FT_PRINTERR("ft_getinfo", -ret);
Expand Down

0 comments on commit bac8244

Please sign in to comment.