httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mladen Turk <mt...@apache.org>
Subject Re: [PATCH] mod_proxy run cleanup on balancer failure
Date Thu, 29 Sep 2005 07:23:12 GMT
Brian Akins wrote:
> 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 error state, so that other modules get a 
> chance to recover from the error.  In my case, I force the cache to 
> serve old data.
> 
>          if (access_status != OK)
> -            return access_status;
> +            goto cleanup;

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) {
      if (access_status != HTTP_SERVICE_UNAVAILABLE)
	return access_status;
      else
	goto cleanup;
}

There is no need to run the request_status hook if the
balancer returns DECLINED, because in that case the URL is
not meant for balancer.
If there are no free endpoints or all are in error state,
the HTTP_SERVICE_UNAVAILABLE will be returned, and only
then calling the request_status hook makes sense.


Regards,
Mladen.

Mime
View raw message