From 88ce5d18a58950ff525a1e6267303f42bb1e6f4d Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Fri, 20 Oct 2017 15:41:18 +0200 Subject: [PATCH] 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. --- src/checks.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.47.3