]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: tasks: Decrement rqueue_size at the right time.
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 26 Jul 2018 12:57:49 +0000 (14:57 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 26 Jul 2018 13:00:58 +0000 (15:00 +0200)
We need to decrement requeue_size when we remove a task form rqueue_local,
not when we remove if from the task list, or we'd also decrement it for any
tasklet, that was never in the rqueue in the first place.

src/task.c

index 86833cf80fac7cb7dfa8ce1a4f66f20719228b87..edb528a102a96ef2cf1b7944d700cc652e9a0310 100644 (file)
@@ -333,6 +333,7 @@ void process_runnable_tasks()
 
                /* detach the task from the queue */
                __task_unlink_rq(t);
+               rqueue_size[tid]--;
                /* And add it to the local task list */
                task_insert_into_tasklet_list(t);
        }
@@ -349,7 +350,6 @@ void process_runnable_tasks()
 
                ctx = t->context;
                process = t->process;
-               rqueue_size[tid]--;
                t->calls++;
                curr_task = (struct task *)t;
                if (likely(process == process_stream))