Make the server more tolerant of most types of errors encountered
during tests. We used to exit if 5 consecutive errors were encountered. Instead, only exit if certain types of fatal errors happen.
Этот коммит содержится в:
родитель
4dcb275b5b
Коммит
b7ab2b4b25
@ -440,11 +440,11 @@ iperf_run_server(struct iperf_test *test)
|
||||
|
||||
if (test->affinity != -1)
|
||||
if (iperf_setaffinity(test, test->affinity) != 0)
|
||||
return -1;
|
||||
return -2;
|
||||
|
||||
if (test->json_output)
|
||||
if (iperf_json_start(test) < 0)
|
||||
return -1;
|
||||
return -2;
|
||||
|
||||
if (test->json_output) {
|
||||
cJSON_AddItemToObject(test->json_start, "version", cJSON_CreateString(version));
|
||||
@ -458,7 +458,7 @@ iperf_run_server(struct iperf_test *test)
|
||||
|
||||
// Open socket and listen
|
||||
if (iperf_server_listen(test) < 0) {
|
||||
return -1;
|
||||
return -2;
|
||||
}
|
||||
|
||||
// Begin calculating CPU utilization
|
||||
|
15
src/main.c
15
src/main.c
@ -129,8 +129,6 @@ sigend_handler(int sig)
|
||||
static int
|
||||
run(struct iperf_test *test)
|
||||
{
|
||||
int consecutive_errors;
|
||||
|
||||
/* Termination signals. */
|
||||
iperf_catch_sigend(sigend_handler);
|
||||
if (setjmp(sigend_jmp_buf))
|
||||
@ -145,21 +143,20 @@ run(struct iperf_test *test)
|
||||
iperf_errexit(test, "error - %s", iperf_strerror(i_errno));
|
||||
}
|
||||
}
|
||||
consecutive_errors = 0;
|
||||
if (iperf_create_pidfile(test) < 0) {
|
||||
i_errno = IEPIDFILE;
|
||||
iperf_errexit(test, "error - %s", iperf_strerror(i_errno));
|
||||
}
|
||||
for (;;) {
|
||||
if (iperf_run_server(test) < 0) {
|
||||
int rc;
|
||||
rc = iperf_run_server(test);
|
||||
if (rc < 0) {
|
||||
iperf_err(test, "error - %s", iperf_strerror(i_errno));
|
||||
++consecutive_errors;
|
||||
if (consecutive_errors >= 5) {
|
||||
iperf_errexit(test, "too many errors, exiting");
|
||||
if (rc < -1) {
|
||||
iperf_errexit(test, "exiting");
|
||||
break;
|
||||
}
|
||||
} else
|
||||
consecutive_errors = 0;
|
||||
}
|
||||
iperf_reset_test(test);
|
||||
if (iperf_get_test_one_off(test))
|
||||
break;
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user