]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: checks: Remove dead code from process_chk_conn()
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 25 May 2020 05:32:01 +0000 (07:32 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 25 May 2020 05:32:28 +0000 (07:32 +0200)
With the checks refactoring, all connections are performed into a tcp-check
ruleset. So, in process_chk_conn(), it is no longer required to check
synchronous error on the connect when an health check is started. This part is
now handled in tcpcheck_main(). And because it is impossible to start a health
check with a connection, all tests on the connection during the health check
startup can be safely removed.

This patch should fix the issue #636. No backport needed.

src/checks.c

index 01a27f87e693264ec02c1dfb1f6b47c272b50139..c3d117ec62d0a79b9fa8cdc163d65f74105707b1 100644 (file)
@@ -3540,47 +3540,10 @@ static struct task *process_chk_conn(struct task *t, void *context, unsigned sho
                b_reset(&check->bo);
 
                task_set_affinity(t, tid_bit);
-               cs = check->cs;
-               conn = cs_conn(cs);
-               if (!conn) {
-                       check->current_step = NULL;
-                       tcpcheck_main(check);
-                       goto out_unlock;
-               }
-
-               conn->flags |= CO_FL_ERROR;
-               chk_report_conn_err(check, 0, 0);
-
-               /* here, we have seen a synchronous error, no fd was allocated */
-               task_set_affinity(t, MAX_THREADS_MASK);
-               if (cs) {
-                       if (check->wait_list.events)
-                               cs->conn->mux->unsubscribe(cs, check->wait_list.events, &check->wait_list);
-                       /* We may have been scheduled to run, and the
-                        * I/O handler expects to have a cs, so remove
-                        * the tasklet
-                        */
-                       tasklet_remove_from_tasklet_list(check->wait_list.tasklet);
-                       cs_destroy(cs);
-                       cs = check->cs = NULL;
-                       conn = NULL;
-               }
-
-               check->state &= ~CHK_ST_INPROGRESS;
-               check_notify_failure(check);
-
-               /* we allow up to min(inter, timeout.connect) for a connection
-                * to establish but only when timeout.check is set
-                * as it may be to short for a full check otherwise
-                */
-               while (tick_is_expired(t->expire, now_ms)) {
-                       int t_con;
 
-                       t_con = tick_add(t->expire, proxy->timeout.connect);
-                       t->expire = tick_add(t->expire, MS_TO_TICKS(check->inter));
-                       if (proxy->timeout.check)
-                               t->expire = tick_first(t->expire, t_con);
-               }
+               check->current_step = NULL;
+               tcpcheck_main(check);
+               goto out_unlock;
        }
        else {
                /* there was a test running.