From: Emeric Brun Date: Fri, 31 Mar 2017 10:04:09 +0000 (+0200) Subject: BUG/MINOR: stream: flag TASK_WOKEN_RES not set if task in runqueue X-Git-Tag: v1.8-dev3~276 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ff4491726f2879ea0ddd69f5c735058938b78476;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/include/proto/stream.h b/include/proto/stream.h index 85c234edc3..5ff22916ae 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;