Hi,
I have noted that AJP proxy behaves strangely when the connection to the
browser is closed when processing the response. For example:
+++
Wed Mar 14 13:46:05 2007] [error] [client 204.136.114.10] proxy: error
processing body, referer: http://xxx.yyy.zzz/site/cart/index.html
[Wed Mar 14 13:46:05 2007] [error] proxy: got bad response (5) from
(null) (app4)
[Wed Mar 14 13:46:05 2007] [error] proxy: BALANCER:
(balancer://appservers). All workers are in error state for route
(app4-engine3)
+++
Find attached the patch I would like to commit in trunk.
Any comments?
Cheers
Jean-Frederic
Index: modules/proxy/mod_proxy_ajp.c
===================================================================
--- modules/proxy/mod_proxy_ajp.c (revision 518577)
+++ modules/proxy/mod_proxy_ajp.c (working copy)
@@ -283,6 +283,7 @@
ap_log_error(APLOG_MARK, APLOG_DEBUG, status,
r->server,
"ap_get_brigade failed");
+ isok = 0;
break;
}
bufsiz = maxsize;
@@ -293,6 +294,7 @@
ap_log_error(APLOG_MARK, APLOG_DEBUG, status,
r->server,
"apr_brigade_flatten failed");
+ isok = 0;
break;
}
}
@@ -303,6 +305,7 @@
if (status != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_DEBUG, status, r->server,
"ajp_send_data_msg failed");
+ isok = 0;
break;
}
conn->worker->s->transferred += bufsiz;
@@ -370,7 +373,7 @@
if (ap_pass_brigade(r->output_filters,
output_brigade) != APR_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
- "proxy: error processing body");
+ "proxy: error processing end");
isok = 0;
}
/* XXX: what about flush here? See mod_jk */
@@ -418,11 +421,11 @@
*/
apr_brigade_cleanup(output_brigade);
- if (status != APR_SUCCESS) {
+ if (! isok) {
/* We had a failure: Close connection to backend */
conn->close++;
ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server,
- "proxy: send body failed to %pI (%s)",
+ "proxy: dialog to %pI (%s) failed",
conn->worker->cp->addr,
conn->worker->hostname);
/*