]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stream: flag TASK_WOKEN_RES not set if task in runqueue
authorEmeric Brun <ebrun@haproxy.com>
Fri, 31 Mar 2017 10:04:09 +0000 (12:04 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 27 Jun 2017 12:37:52 +0000 (14:37 +0200)
Under certain circumstances, if a stream's task is first woken up
(eg: I/O event) then notified of the availability of a buffer it
was waiting for via stream_res_wakeup(), this second event is lost
because the flags are only merged after seeing that the task is
running. At the moment it seems that the TASK_WOKEN_RES event is
not explicitly checked for, but better fix this before getting
reports of lost events.

This fix removes this "task running" test which is properly
performed in task_wakeup(), while the flags are properly merged.

It must be backported to 1.7 and 1.6.

include/proto/stream.h

index 85c234edc38ceef67efcf4cf6aaa6509d4073c1c..5ff22916aef7c90e7c21927f43e261ff92c7856e 100644 (file)
@@ -286,7 +286,7 @@ static void inline stream_init_srv_conn(struct stream *sess)
  * it returns 0. */
 static int inline stream_res_wakeup(struct stream *s)
 {
-       if (s->task->state & TASK_RUNNING || task_in_rq(s->task))
+       if (s->task->state & TASK_RUNNING)
                return 0;
        task_wakeup(s->task, TASK_WOKEN_RES);
        return 1;