Search the web
Sign In
New User? Sign Up
new-httpd
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
[PATCH] mod_proxy run cleanup on balancer failure   Message List  
Reply | Forward Message #56485 of 56488 |
Re: [PATCH] mod_proxy run cleanup on balancer failure

Can we get a vote on this? Jim gave it +1. So do I. I would like this
to be in a beta "release." This fix is important to our environment.


r.pluem@... wrote:
>
> Jim Jagielski wrote:
>
>>Sorry :)
>
>
> Thanks. So I guess this should be fine:
>
> Index: mod_proxy.c
> ===================================================================
> --- mod_proxy.c (Revision 280422)
> +++ mod_proxy.c (Arbeitskopie)
> @@ -679,8 +679,22 @@
> char *url = uri;
> /* Try to obtain the most suitable worker */
> access_status = ap_proxy_pre_request(&worker, &balancer, r, conf,
&url);
> - if (access_status != OK)
> - return access_status;
> + if (access_status != OK) {
> + /*
> + * Only return if access_status is not HTTP_SERVICE_UNAVAILABLE
> + * This gives other modules the chance to hook into the
> + * request_status hook and decide what to do in this situation.
> + */
> + if (access_status != HTTP_SERVICE_UNAVAILABLE)
> + return access_status;
> + /*
> + * Ensure that balancer is NULL if worker is NULL to prevent
> + * potential problems in the post_request hook.
> + */
> + if (!worker)
> + balancer = NULL;
> + goto cleanup;
> + }
> if (balancer && balancer->max_attempts_set && !max_attempts)
> max_attempts = balancer->max_attempts;
> /* firstly, try a proxy, unless a NoProxy directive is active */
>
> [..cut..]
>


--
Brian Akins
Lead Systems Engineer
CNN Internet Technologies



Fri Oct 28, 2005 1:36 pm

bakins@...
Send Email Send Email

Forward
Message #56485 of 56488 |
Expand Messages Author Sort by Date

Here is a trivial patch that will allow proxy_handler to run the request_status hook if pre_request fails. This is necessary if all balncer members are in an...
Brian Akins
bakins@...
Send Email
Sep 28, 2005
2:29 pm

... If all workers are in error state, worker will be NULL. Are you sure that the post_request hook that is run in the balancer case is prepared for such a...
r.pluem@...
Send Email
Sep 28, 2005
9:09 pm

... Hmmm... It might be best to, in ap_proxy_pre_request() set *balancer to NULL if the result from proxy_run_pre_request() isn't OK. Then we can call jump to...
Jim Jagielski
jim@...
Send Email
Sep 29, 2005
12:59 pm

... [..cut..] ... Yes, this sounds like the better solution here. ... Yes, I think you are right. It should be *balancer. Regards Rüdiger...
r.pluem@...
Send Email
Sep 29, 2005
1:10 pm

... goto cleanup; will actually run the request_status optional hook, so the patch makes sense, although I would make it as follows: if (access_status != OK) {...
Mladen Turk
mturk@...
Send Email
Sep 29, 2005
7:26 am

... I guess that makes sense. I just want to chatch the following cases: No available workers - all in error or busy worker failed - ie connect timeout random...
Brian Akins
brian.akins@...
Send Email
Sep 29, 2005
1:41 pm

... The rub, as mentioned, is to ensure that when jumping to cleanup, balancer is never non-NULL with a NULL worker, so we need to check if that ever happens....
Jim Jagielski
jim@...
Send Email
Sep 29, 2005
2:49 pm

... What about the following patch? I think it should address all the things discussed. Regards Rüdiger Index: mod_proxy.c ... +++ mod_proxy.c (Arbeitskopie) ...
r.pluem@...
Send Email
Sep 29, 2005
4:01 pm

Except for the formatting +1 :)...
Jim Jagielski
jim@...
Send Email
Sep 29, 2005
4:43 pm

As I try to improve my Apache code style awareness. What is wrong with the formatting? Regards Rüdiger...
r.pluem@...
Send Email
Sep 29, 2005
6:33 pm

Sorry :) The single line if statements. The pref is if (foo) banana(); rather than if (foo) banana();...
Jim Jagielski
jim@...
Send Email
Sep 29, 2005
6:50 pm

... Thanks. So I guess this should be fine: Index: mod_proxy.c ... +++ mod_proxy.c (Arbeitskopie) @@ -679,8 +679,22 @@ char *url = uri; /* Try to obtain the...
r.pluem@...
Send Email
Sep 29, 2005
7:49 pm

Can we get a vote on this? Jim gave it +1. So do I. I would like this to be in a beta "release." This fix is important to our environment. ... -- Brian...
Brian Akins
bakins@...
Send Email
Oct 28, 2005
1:45 pm

... Never mind. See this in trunk... -- Brian Akins Lead Systems Engineer CNN Internet Technologies...
Brian Akins
brian.akins@...
Send Email
Oct 28, 2005
1:47 pm

... It is also backported to 2.2.x. So it will be part of 2.1.9 Regards Rüdiger...
Ruediger Pluem
rpluem@...
Send Email
Oct 28, 2005
5:14 pm

... http://httpd.apache.org/dev/styleguide.html The basic objection to your patch would be that statements after your if's; put them on the next line. HTH, ...
Sander Striker
s.striker@...
Send Email
Sep 29, 2005
7:32 pm

... This means if access_status is DECLINED, we would return. Would that work for you??...
Jim Jagielski
jim@...
Send Email
Sep 29, 2005
4:31 pm

... Yes. Just need to run request_status in case of error. -- Brian Akins Lead Systems Engineer CNN Internet Technologies...
Brian Akins
brian.akins@...
Send Email
Sep 29, 2005
4:32 pm

+1 ... -- ======================================================================= Jim Jagielski [|] jim@... [|] http://www.jaguNET.com/ "If you...
Jim Jagielski
jim@...
Send Email
Sep 29, 2005
7:50 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help