PATCH: reproxy with multiple urls fails with a 503

Del Raco el_draco at yahoo.com
Wed Sep 26 03:35:31 UTC 2007


Hi,

This seems to occur when reproxy is passed with an
even number of URLs, and the odd ones are 404'ing.  It
appears that ClientProxy.pm's use_reproxy_backend() is
doing an unnecessary shift.

Here're some patches for Perlbal 1.59.

diff -uw ClientProxy.pm.orig ClientProxy.pm
--- ClientProxy.pm.orig 2007-09-25 20:17:12.000000000
-0700
+++ ClientProxy.pm      2007-09-25 20:17:19.000000000
-0700
@@ -216,7 +216,7 @@
     my Perlbal::BackendHTTP $be = $_[1];
 
     # get a URI
-    my $datref = $self->{currently_reproxying} =
shift @{$self->{reproxy_uris}};
+    my $datref = $self->{currently_reproxying} =
$self->{reproxy_uris}->[0];
     unless (defined $datref) {
         # return error and close the backend
         $be->close('invalid_uris');


diff -uw 35-reproxy.t.orig 35-reproxy.t
--- 35-reproxy.t.orig   2007-09-25 20:06:06.000000000
-0700
+++ 35-reproxy.t        2007-09-25 20:07:16.000000000
-0700
@@ -132,6 +132,7 @@
 
 # try to reproxy to a list of URLs, where the first
one is bogus, and last one is good
 ok_reproxy_url_list();
+ok_reproxy_url_list2();
 
 # responses to HEAD requests should not have a body
 {
@@ -154,6 +155,11 @@
     ok($resp->content eq $file_content, "reproxy URL
w/ dead one first");
 }
 
+sub ok_reproxy_url_list2 {
+    my $resp =
$wc->request("reproxy_url:http://127.0.0.1:$webport/baz.txt
http://127.0.0.1:$webport/foo.txt");
+    ok($resp->content eq $file_content, "reproxy URL
w/ 404 first");
+}
+
 sub ok_reproxy_file {
     my $resp =
$wc->request("reproxy_file:$dir/foo.txt");
     ok($resp && $resp->content eq $file_content,
"reproxy file");


       
____________________________________________________________________________________
Yahoo! oneSearch: Finally, mobile search 
that gives answers, not web links. 
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC


       
____________________________________________________________________________________
Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out. 
http://answers.yahoo.com/dir/?link=list&sid=396545433


More information about the perlbal mailing list