From: Christopher Faulet Date: Fri, 20 Oct 2017 13:41:18 +0000 (+0200) Subject: MINOR: threads/checks: Set the task process_mask when a check is executed X-Git-Tag: v1.8-rc1~116 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=88ce5d18a58950ff525a1e6267303f42bb1e6f4d;p=thirdparty%2Fhaproxy.git MINOR: threads/checks: Set the task process_mask when a check is executed Tasks used to process checks are created to be processed by any threads. But, once a check is started, we must be sure to be sticky on the running thread because I/O will be also sticky on it. This is a requirement for now: Tasks and I/O handlers linked to the same session must be executed on the same thread. --- diff --git a/src/checks.c b/src/checks.c index cf1c59e4c0..0944c0e3bf 100644 --- a/src/checks.c +++ b/src/checks.c @@ -1977,7 +1977,7 @@ static struct task *process_chk_proc(struct task *t) int t_con = tick_add(now_ms, s->proxy->timeout.connect); t->expire = tick_first(t->expire, t_con); } - + task_set_affinity(t, tid_bit); goto reschedule; } @@ -2040,6 +2040,7 @@ static struct task *process_chk_proc(struct task *t) /* a success was detected */ check_notify_success(check); } + task_set_affinity(t, MAX_THREADS_MASK); check->state &= ~CHK_ST_INPROGRESS; pid_list_del(check->curpid); @@ -2114,6 +2115,7 @@ static struct task *process_chk_conn(struct task *t) if (check->type) conn_xprt_want_recv(conn); /* prepare for reading a possible reply */ + task_set_affinity(t, tid_bit); goto reschedule; case SF_ERR_SRVTO: /* ETIMEDOUT */ @@ -2205,6 +2207,7 @@ static struct task *process_chk_conn(struct task *t) /* a success was detected */ check_notify_success(check); } + task_set_affinity(t, MAX_THREADS_MASK); check->state &= ~CHK_ST_INPROGRESS; rv = 0;