Hi Patrick,

On Tue, Jun 05, 2018 at 05:02:41PM -0400, Patrick Hemmer wrote:
> It seems that commit b0bdae7 has completely broken haproxy for me. When
> I send a request to haproxy, it just sits there. The backend server
> receives nothing, and the client waits for a response.
> Running with debug enabled I see just a single line:
> 00000000:f1.accept(0004)=0005 from [] ALPN=<none>
> commit b0bdae7b88d53cf8f18af0deab6d4c29ac25b7f9 (refs/bisect/bad)
> Author: Olivier Houchard <ohouch...@haproxy.com>
> Date:   Fri May 18 18:45:28 2018 +0200
>     MAJOR: tasks: Introduce tasklets.
>     Introduce tasklets, lightweight tasks. They have no notion of priority,
>     they are just run as soon as possible, and will probably be used for I/O
>     later.
>     For the moment they're used to replace the temporary thread-local list
>     that was used in the scheduler. The first part of the struct is common
>     with tasks so that tasks can be cast to tasklets and queued in this
> list.
>     Once a task is in the tasklet list, it has its leaf_p set to 0x1 so that
>     it cannot accidently be confused as not in the queue.
>     Pure tasklets are identifiable by their nice value of -32768 (which is
>     normally not possible).
> Issue reproducible with a very simple config:
> defaults
>   mode http
> frontend f1
>   bind :8081
>   default_backend b1
> backend b1
>   server s1
> Compiled on OS-X with only a single make variable of TARGET=osx
> Compiler: clang-900.0.39.2

Oops, seems I broke haproxy when built without thread support.
The attached patch should fix both the issues you reported, can you confirm
it ?

Thanks a lot !

>From d3c0abb18b44a942dcc7ead072be84f323184d0f Mon Sep 17 00:00:00 2001
From: Olivier Houchard <ohouch...@haproxy.com>
Date: Wed, 6 Jun 2018 14:01:08 +0200
Subject: [PATCH] BUG/MEDIUM: tasks: Use the local runqueue when building
 without threads.

When building without threads enabled, instead of just using the global
runqueue, just use the local runqueue associated with the only thread, as
that's what is now expected for a single thread in prcoess_runnable_tasks().
This should fix haproxy when built without threads.
 include/proto/task.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/proto/task.h b/include/proto/task.h
index 0c2c5f28c..dc8a54481 100644
--- a/include/proto/task.h
+++ b/include/proto/task.h
@@ -133,7 +133,7 @@ static inline void task_wakeup(struct task *t, unsigned int 
                root = &rqueue;
-       struct eb_root *root = &rqueue;
+       struct eb_root *root = &rqueue_local[tid];
        state = HA_ATOMIC_OR(&t->state, f);

Reply via email to