httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Plüm, Rüdiger, VIS <ruediger.pl...@vodafone.com>
Subject AW: svn commit: r378032 - in /httpd/httpd/trunk: CHANGES modules/proxy/mod_proxy_http.c modules/proxy/proxy_util.c
Date Mon, 20 Feb 2006 11:52:31 GMT


> -----Ursprüngliche Nachricht-----
> Von: Joe Orton 
> > Could you please give the following patch a try?
> 
> That fixed most of the failures, there are still two left:

OK. That gives a better idea what possibly goes wrong.

> 
> t/ssl/proxy....ok 61/172# Failed test 62 in t/ssl/proxy.t at line 112 
> fail #2
> t/ssl/proxy....ok 112/172# Failed test 113 in 
> /local/httpd/pf-trunk/blib/lib/Apache/TestCommonPost.pm at 
> line 131 fail 
> #102
> t/ssl/proxy....FAILED tests 62, 113
>         Failed 2/172 tests, 98.84% okay
> 
> I found only one pertinent error message in the log:
> 
> [Mon Feb 20 10:40:08 2006] [debug] proxy_util.c(2118): proxy: HTTP: 
> connection complete to 127.0.0.1:8529 (localhost.localdomain) 

But this is HTTP to the backend isn't it?


> [Mon Feb 20 10:40:08 2006] [error] (32)Broken pipe: proxy: 
> pass request 
> body failed to 127.0.0.1:8529 (localhost.localdomain)
> [Mon Feb 20 10:40:08 2006] [error] (32)Broken pipe: proxy: 
> pass request 
> body failed to 127.0.0.1:8529 (localhost.localdomain) from 
> 127.0.0.1 ()
> 
> ...perhaps a persistent connection being closed by the 
> backend, and the 
> proxy only finding out about this half way through sending a request 

Also my guess. See also point 2 in http://mail-archives.apache.org/mod_mbox/httpd-dev/200602.mbox/ajax/%3c43F0FBFD.6040403@apache.org%3e
Is it possible to increase the keepalive timeout temporarily for a test run?
This would give a valuable hint?

> body?  Hard to handle that in the proxy - probably best to just 
> ungracefully terminate the connection to the client in that case, it 
> should then resend appropriately too.

Yes, if get into this situation I guess we have no better chance. But that should already
be the reaction to this kind of situation.
Ok, I see that this is currently not the case (at least not if we fail during
sending the reponse). The following patch should sent
a 502 to the client in such cases and close the connection to the client:

Index: mod_proxy_http.c
===================================================================
--- mod_proxy_http.c    (revision 379071)
+++ mod_proxy_http.c    (working copy)
@@ -1711,8 +1711,17 @@
 
 cleanup:
     if (backend) {
-        if (status != OK)
+        if (status != OK) {
             backend->close = 1;
+            if (!r->eos_sent) {
+                apr_bucket_brigade *bb;
+
+                bb = apr_brigade_create(p, c->bucket_alloc);
+                ap_proxy_backend_broke(r, bb);
+                ap_pass_brigade(r->output_filters, bb);
+                apr_brigade_destroy(bb);
+            }
+        }
         ap_proxy_http_cleanup(proxy_function, r, backend);
     }
     return status;

But I had the idea to use a possible keepalive header feedback from the
backend to get a feeling at which point of time the backend will close
the connection

Regards

Rüdiger

Mime
View raw message