Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

test: add sleep(1) to mtt_client_connect() before the next retry #2087

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- detecting no free slot for a new connection request in example 13
- memory allocations in example 07
- minor issues detected by Coverity
- sleep(1) added to mtt_client_connect() before the next connection retry

### Changed
- the default 'master' branch has been renamed to 'main'
Expand Down
4 changes: 3 additions & 1 deletion tests/multithreaded/common/mtt_connect.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// SPDX-License-Identifier: BSD-3-Clause
/* Copyright 2022, Intel Corporation */
/* Copyright 2022-2023, Intel Corporation */

/*
* mtt_connect.c -- common connection code of multithreaded tests
*/

#include <stdlib.h>
#include <librpma.h>
#include <unistd.h>

#include "mtt.h"

Expand Down Expand Up @@ -248,6 +249,7 @@ mtt_client_connect(struct mtt_result *tr, char *addr, unsigned port,
/* received the RPMA_CONN_REJECTED event, retrying ... */
(void) rpma_conn_disconnect(*conn_ptr);
(void) rpma_conn_delete(conn_ptr);
sleep(1);

} while (retry < MAX_CONN_RETRY);

Expand Down