httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 47063] New: mod_proxy doesn't call post_request handler when the worker returned by pre_request is unusable
Date Tue, 21 Apr 2009 14:19:43 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=47063

           Summary: mod_proxy doesn't call post_request handler when the
                    worker returned by pre_request is unusable
           Product: Apache httpd-2
           Version: 2.2.11
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_proxy
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: binder@arago.de


Created an attachment (id=23520)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23520)
Patch to call the post_request handler in proxy_handler() before trying a new
worker

We're running an environment with Apache 2.2.11 acting as reverse proxy for
several Apache Tomcat servers, using mod_proxy_balancer and its "bybusyness"
method. We've noticed that when one of the backend servers fails during heavy
load, it will almost never be used again once it is restored, even though the
corresponding worker shows up as "OK" in the balancer manager.

Investigating this a little, I've found that the "busy" counter of the affected
worker is a lot greater than zero, causing it to be ignored by the "bybusyness"
algorithm unless the proxy is under really heavy load again. I've finally
tracked it down to the while loop in mod_proxy.c which tries to find a suitable
worker to handle the current request: It calls ap_proxy_pre_request(), which
will increase the "busy" counter of the worker returned, but if that worker
fails to serve the request, ap_proxy_pre_request() will be called again without
calling proxy_run_post_request() for the worker that failed, so that its "busy"
counter will never be decremented again.

I've created a small patch to fix this, but as I'm not an Apache hacker, I
cannot tell whether it is the right way to fix the issue. At least, it
succeeded in fixing the problem in our environment, without causing any
unwanted side effects up to now.

While debugging this issue, I've also added a "busyness" column to
balancer-handler, which can be found as an attachment to bug #46215.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message