Re: svn commit: r734703 - /httpd/httpd/trunk/modules/proxy/mod_proxy.c

2009-01-18 Thread Ruediger Pluem


On 01/18/2009 06:44 PM, Jeff Trawick wrote:
> On Thu, Jan 15, 2009 at 8:44 AM,  wrote:
> 
>> Author: rpluem
>> Date: Thu Jan 15 05:44:23 2009
>> New Revision: 734703
>>
>> URL: http://svn.apache.org/viewvc?rev=734703&view=rev
>> Log:
>> * Set the error time if we set a worker in error mode.
> 
> 
>> Modified:
>>httpd/httpd/trunk/modules/proxy/mod_proxy.c
>>
>> Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.c
>> URL:
>> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.c?rev=734703&r1=734702&r2=734703&view=diff
> 
> 
> Should the error time be set in set_worker_param() as well?
> 
>else if (*v == 'E' || *v == 'e') {
> if (mode)
> ->  worker->status |= PROXY_WORKER_IN_ERROR;

Well this is not possible here since error_time only lives in the shared
mem of the scoreboard (worker->s) and not in the config of a worker.
But worker->s is not initialized at this point of time (this is done in the
child_init hook).
The scoreboard area storing the error_time is initialized with 0, so
this variable has a defined value.

To be honest I do not get the real use of setting a worker into error mode
during configuration time. But this may be just me and someone else has a
real use for it.

Regards

RĂ¼diger




Re: svn commit: r734703 - /httpd/httpd/trunk/modules/proxy/mod_proxy.c

2009-01-18 Thread Jeff Trawick
On Thu, Jan 15, 2009 at 8:44 AM,  wrote:

> Author: rpluem
> Date: Thu Jan 15 05:44:23 2009
> New Revision: 734703
>
> URL: http://svn.apache.org/viewvc?rev=734703&view=rev
> Log:
> * Set the error time if we set a worker in error mode.


>
> Modified:
>httpd/httpd/trunk/modules/proxy/mod_proxy.c
>
> Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.c
> URL:
> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.c?rev=734703&r1=734702&r2=734703&view=diff


Should the error time be set in set_worker_param() as well?

   else if (*v == 'E' || *v == 'e') {
if (mode)
->  worker->status |= PROXY_WORKER_IN_ERROR;
else
worker->status &= ~PROXY_WORKER_IN_ERROR;
}


>
> 
>
> ==
> --- httpd/httpd/trunk/modules/proxy/mod_proxy.c (original)
> +++ httpd/httpd/trunk/modules/proxy/mod_proxy.c Thu Jan 15 05:44:23 2009
> @@ -1020,8 +1020,10 @@
>  * We can not failover to another worker.
>  * Mark the worker as unusable if member of load balancer
>  */
> -if (balancer)
> +if (balancer) {
> worker->s->status |= PROXY_WORKER_IN_ERROR;
> +worker->s->error_time = apr_time_now();
> +}
> break;
> }
> else if (access_status == HTTP_SERVICE_UNAVAILABLE) {
> @@ -1031,6 +1033,7 @@
>  */
> if (balancer) {
> worker->s->status |= PROXY_WORKER_IN_ERROR;
> +worker->s->error_time = apr_time_now();
> }
> }
> else {
>
>
>


-- 
Born in Roswell... married an alien...