From ff4491726f2879ea0ddd69f5c735058938b78476 Mon Sep 17 00:00:00 2001 From: Emeric Brun Date: Fri, 31 Mar 2017 12:04:09 +0200 Subject: [PATCH] BUG/MINOR: stream: flag TASK_WOKEN_RES not set if task in runqueue 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/proto/stream.h b/include/proto/stream.h index 85c234e..5ff2291 100644 --- a/include/proto/stream.h +++ b/include/proto/stream.h @@ -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; -- 1.7.10.4