From: Willy Tarreau Date: Tue, 10 Mar 2015 16:16:10 +0000 (+0100) Subject: Revert "BUG/MEDIUM: lua: can't handle the response bytes" X-Git-Tag: v1.6-dev1~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=76bd97f405805135588f3cf59867e2613dbeb6d2;p=thirdparty%2Fhaproxy.git Revert "BUG/MEDIUM: lua: can't handle the response bytes" This reverts commit cd9084f77683106ace2fb863080e7d10e71c39fc. This commit introduced a regression making it impossible to leave process_session() during a forced yield because the analyser was always set on the response even if not needed. The result was a busy loop making haproxy spin at 100% without even polling anymore in case a forced yield was performed. The problem it tried to address (intercept response data from a request analyser before forwarding) is not a trivial issue to address since wakeups based on reads will not necessarily happen unless there's write activity. Anyway, if functions are attached specifically to a request or to a response, it's for a reason. So for now let's be clear about the fact that it's unreliable to try to process data from the opposite channel until a better solution is found. --- diff --git a/src/hlua.c b/src/hlua.c index 084b7d52af..c08c750070 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -3388,9 +3388,9 @@ static int hlua_request_act_wrapper(struct hlua_rule *rule, struct proxy *px, */ if (HLUA_IS_WAKERESWR(&s->hlua)) { s->rep->flags |= CF_WAKE_WRITE; + if ((analyzer & (AN_REQ_INSPECT_FE|AN_REQ_HTTP_PROCESS_FE))) + s->rep->analysers |= analyzer; } - if ((analyzer & (AN_REQ_INSPECT_FE|AN_REQ_HTTP_PROCESS_FE))) - s->rep->analysers |= analyzer; if (HLUA_IS_WAKEREQWR(&s->hlua)) s->req->flags |= CF_WAKE_WRITE; return 0;