You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rp...@apache.org on 2021/03/02 20:02:32 UTC
svn commit: r1887116 - in /httpd/httpd/branches/2.4.x: ./ STATUS
modules/proxy/mod_proxy_ajp.c modules/proxy/proxy_util.c
Author: rpluem
Date: Tue Mar 2 20:02:32 2021
New Revision: 1887116
URL: http://svn.apache.org/viewvc?rev=1887116&view=rev
Log:
Merge r1398307, r1465839, r1530603, r1578759, r1729507 from trunk:
* If we face a timeout during receiving the response from the backend and if
we pinged it successfully before don't assume the whole backend has failed.
Assume that only the request has failed and return a gateway timeout then.
Add failontimeout to allow server admin to mark balancer member in err if IO timeout occurs.
ping tuning via Yann Ylavic <yl...@gmail.com>
Use 'apr_table_setn' instead of 'apr_table_set' when possible in order to save memory.
mod_proxy: axe negative "ping" parameter setting and handling.
This used to check for the backend connection readability only (instead of
the full ping/100-continue round-trip), but the case is already handled by
ap_proxy_connect_backend() which is always called.
Submitted by: rpluem, druggeri, jim, jailletc36, ylavic
Reviewed by: rpluem, ylavic, icing
Github: closes #170
Modified:
httpd/httpd/branches/2.4.x/ (props changed)
httpd/httpd/branches/2.4.x/STATUS
httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_ajp.c
httpd/httpd/branches/2.4.x/modules/proxy/proxy_util.c
Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
Merged /httpd/httpd/trunk:r1398307,1465839,1530603,1578759
Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1887116&r1=1887115&r2=1887116&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Tue Mar 2 20:02:32 2021
@@ -169,22 +169,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
CI results: https://travis-ci.com/github/apache/httpd/builds/213760432
+1: jorton, ylavic, icing
- *) mod_proxy_ajp: If we face a timeout during receiving the response from the
- backend and if we pinged it successfully before don't assume the whole
- backend has failed. Assume that only the request has failed and return a
- gateway timeout then.
- Hint the changes to the other files in r1465839, r1530603, r1729507 were
- already backported earlier.
- Trunk version of patch:
- https://svn.apache.org/r1398307
- https://svn.apache.org/r1465839
- https://svn.apache.org/r1530603
- https://svn.apache.org/r1578759
- https://svn.apache.org/r1729507
- Backport version for 2.4.x of patch:
- https://patch-diff.githubusercontent.com/raw/apache/httpd/pull/170.diff
- +1: rpluem, ylavic, icing
-
*) mod_proxy_hcheck: Don't pile up health checks if the previous one did
not finish before hcinterval. PR 63010.
trunk patch: http://svn.apache.org/r1885691
Modified: httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_ajp.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_ajp.c?rev=1887116&r1=1887115&r2=1887116&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_ajp.c (original)
+++ httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_ajp.c Tue Mar 2 20:02:32 2021
@@ -349,7 +349,8 @@ static int ap_proxy_ajp_request(apr_pool
* we assume it is a request that cause a back-end timeout,
* but doesn't affect the whole worker.
*/
- if (APR_STATUS_IS_TIMEUP(status) && conn->worker->s->ping_timeout_set) {
+ if (APR_STATUS_IS_TIMEUP(status) &&
+ conn->worker->s->ping_timeout_set) {
return HTTP_GATEWAY_TIME_OUT;
}
@@ -680,7 +681,18 @@ static int ap_proxy_ajp_request(apr_pool
*/
rv = HTTP_SERVICE_UNAVAILABLE;
} else {
- rv = HTTP_INTERNAL_SERVER_ERROR;
+ /* If we had a successful cping/cpong and then a timeout
+ * we assume it is a request that cause a back-end timeout,
+ * but doesn't affect the whole worker.
+ */
+ if (APR_STATUS_IS_TIMEUP(status) &&
+ conn->worker->s->ping_timeout_set) {
+ apr_table_setn(r->notes, "proxy_timedout", "1");
+ rv = HTTP_GATEWAY_TIME_OUT;
+ }
+ else {
+ rv = HTTP_INTERNAL_SERVER_ERROR;
+ }
}
}
else if (client_failed) {
Modified: httpd/httpd/branches/2.4.x/modules/proxy/proxy_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/proxy/proxy_util.c?rev=1887116&r1=1887115&r2=1887116&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/branches/2.4.x/modules/proxy/proxy_util.c Tue Mar 2 20:02:32 2021
@@ -3767,6 +3767,7 @@ PROXY_DECLARE(int) ap_proxy_create_hdrbr
proxy_dir_conf *dconf = ap_get_module_config(r->per_dir_config, &proxy_module);
/*
+ * HTTP "Ping" test? Easiest is 100-Continue. However:
* To be compliant, we only use 100-Continue for requests with bodies.
* We also make sure we won't be talking HTTP/1.0 as well.
*/