CLEANUP: checks: don't report report the fork() error twice
Upon fork() error, a first report is immediately made by connect_proc_chk()
via set_server_check_status(), then process_chk_proc() detects the error
code and makes up a dummy connection error to call chk_report_conn_err(),
which tries to retrieve the errno code from the connection, fails, then
saves the status message from the check, fails all "if" tests on its path
related to the connection then resets the check's state to the current one
with the current status message. All this useless chain is the only reason
why process checks require a connection! Let's simply get rid of this second
useless call.
diff --git a/src/checks.c b/src/checks.c
index 8e06e8c..3284b53 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -1916,7 +1916,6 @@
{
struct check *check = t->context;
struct server *s = check->server;
- struct connection *conn = check->conn;
int rv;
int ret;
int expired = tick_is_expired(t->expire, now_ms);
@@ -1940,8 +1939,7 @@
check->state |= CHK_ST_INPROGRESS;
ret = connect_proc_chk(t);
- switch (ret) {
- case SF_ERR_NONE:
+ if (ret == SF_ERR_NONE) {
/* the process was forked, we allow up to min(inter,
* timeout.connect) for it to report its status, but
* only when timeout.check is set as it may be to short
@@ -1955,11 +1953,6 @@
}
goto reschedule;
-
- default:
- conn->flags |= CO_FL_ERROR;
- chk_report_conn_err(check, 0, 0);
- break;
}
/* here, we failed to start the check */