You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2021/10/19 15:07:26 UTC
[Bug 65642] New: mod_proxy: retry-directive does not work anymore
https://bz.apache.org/bugzilla/show_bug.cgi?id=65642
Bug ID: 65642
Summary: mod_proxy: retry-directive does not work anymore
Product: Apache httpd-2
Version: 2.4.51
Hardware: Other
Status: NEW
Severity: major
Priority: P2
Component: mod_proxy
Assignee: bugs@httpd.apache.org
Reporter: max.moebius1@gmail.com
Target Milestone: ---
Until Version 2.4.16 (last version I checked) the reverse proxy deactivated a
worker in case the URL was down for "retry"-Seconds.
Configuration:
ProxyPass /YYYYY/XXX/ http://XXX:1234/ retry=5 connectiontimeout=30
Example from 2.4.16 Log (subsequent requests to the same backend are answered
immediately with return-code 503):
[Tue Sep 21 10:42:35.663877 2021] [proxy_http:error] [pid 9144:tid 8124]
[client x.x.x.x:50803] AH01114: HTTP: failed to make connection to backend: XXX
[Tue Sep 21 10:44:12.192333 2021] [proxy:error] [pid 9144:tid 7668] (OS 10060)A
connection attempt failed because the connected party did not properly respond
after a period of time, or established connection failed because connected host
has failed to respond. : AH00957: HTTP: attempt to connect to y.y.y.y:1234
(XXX) failed
[Tue Sep 21 10:44:12.192333 2021] [proxy:error] [pid 9144:tid 7668] AH00959:
ap_proxy_connect_backend disabling worker for (XXX) for 5s
[Tue Sep 21 10:44:12.192333 2021] [proxy_http:error] [pid 9144:tid 7668]
[client x.x.x.x:50837] AH01114: HTTP: failed to make connection to backend: XXX
[Tue Sep 21 10:44:12.736341 2021] [proxy:error] [pid 9144:tid 5972] AH00940:
HTTP: disabled connection for (XXX)
[Tue Sep 21 10:44:12.752309 2021] [proxy:error] [pid 9144:tid 5972] AH00940:
HTTP: disabled connection for (XXX)
[Tue Sep 21 10:44:12.769313 2021] [proxy:error] [pid 9144:tid 5972] AH00940:
HTTP: disabled connection for (XXX)
[Tue Sep 21 10:44:12.785412 2021] [proxy:error] [pid 9144:tid 5972] AH00940:
HTTP: disabled connection for (XXX)
Current Version 2.4.51 does not respect the retry-setting. It does not disable
the worker. Subsequent requests have to wait for 20s:
[Tue Oct 19 10:17:30.891993 2021] [proxy_http:error] [pid 15356:tid 7156]
[client x.x.x.x:51075] AH01114: HTTP: failed to make connection to backend: XXX
[Tue Oct 19 10:17:51.910382 2021] [proxy:error] [pid 15356:tid 8112] (OS
10060)A connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed because
connected host has failed to respond. : AH00957: http: attempt to connect to
y.y.y.y:1234 (XXX) failed
[Tue Oct 19 10:17:51.910382 2021] [proxy_http:error] [pid 15356:tid 8112]
[client x.x.x.x:51079] AH01114: HTTP: failed to make connection to backend: XXX
[Tue Oct 19 10:18:12.975273 2021] [proxy:error] [pid 15356:tid 8112] (OS
10060)A connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed because
connected host has failed to respond. : AH00957: http: attempt to connect to
y.y.y.y:1234 (XXX) failed
--
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
[Bug 65642] mod_proxy: retry-directive does not work anymore
Posted by "bugzilla.apache.org via bugs" <bu...@httpd.apache.org>.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65642
abernal <ab...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
OS| |All
--- Comment #1 from abernal <ab...@apache.org> ---
Root-caused this. It's not a regression, it's an intentional behavior change:
commit 1f6fd365c3 (Yann Ylavic, 2015-01-07, "mod_proxy: Don't put non
balancer-member workers in error state by default for connection or 500/503
errors, and honor status=+I for any error. PR 48388") added this to
proxy_util.c's worker creation:
if (!balancer) {
wshared->status |= PROXY_WORKER_IGNORE_ERRORS;
}
Every worker that is not a member of a <Proxy balancer://...> (i.e. any plain
ProxyPass) gets PROXY_WORKER_IGNORE_ERRORS set at creation. Both
ap_proxy_connect_backend()'s and mod_proxy.c's "mark worker in error" logic are
gated on this flag not being set, so retry= has no effect at all by default for
a plain ProxyPass worker -- by design, since 2.4.17/2.4.18ish. That exactly
matches your own timeline (worked through 2.4.16, broken after).
Confirmed the documented opt-out restores the old behavior. I reproduced with a
real backend address that genuinely times out on connect:
ProxyPass "/svc/" "http://10.255.255.1:80/" retry=5 connectiontimeout=2
status=-I
First request takes the full 2s (connect attempt), and a second request within
the retry=5 window now returns instantly (503) instead of re-attempting the
connection -- exactly the behavior you're asking for. Without "status=-I" both
requests take the full 2s every time.
So the fix for your setup is adding status=-I to the ProxyPass line. The real
gap I found is in the documentation: the "retry=" parameter description in
mod_proxy.xml doesn't mention that it has no effect for a non-balancer worker
unless status=-I is also set. Happy to send a small doc patch for that if it'd
help; let me know.
--
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
[Bug 65642] mod_proxy: retry-directive does not work anymore
Posted by "bugzilla.apache.org via bugs" <bu...@httpd.apache.org>.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65642
--- Comment #2 from abernal <ab...@apache.org> ---
Docs patch proposed to clarify this: https://github.com/apache/httpd/pull/996
--
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