You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ruediger Pluem <rp...@apache.org> on 2006/08/03 21:43:15 UTC

Re: svn commit: r428437 - /httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c


On 08/03/2006 06:01 PM, jfclere@apache.org wrote:
> Author: jfclere
> Date: Thu Aug  3 09:01:50 2006
> New Revision: 428437
> 
> URL: http://svn.apache.org/viewvc?rev=428437&view=rev
> Log:
> Use only one slotmem for status and checker.
> 
> Modified:
>     httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c
> 
> Modified: httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c?rev=428437&r1=428436&r2=428437&view=diff
> ==============================================================================
> --- httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c (original)
> +++ httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c Thu Aug  3 09:01:50 2006
> @@ -40,13 +40,19 @@
>  {
>      const health_worker_method *worker_storage;
>      worker_storage = ap_lookup_provider(PROXY_CKMETHOD, "default", "0");
> +    proxy_server_conf *sconf = ap_get_module_config(s->module_config,
> +                                                    &proxy_module);
> +    char *slotmem_loc = sconf->slotmem_loc;
>      
>      if (worker_storage) {
>          apr_status_t rv;
> -        rv = worker_storage->create_slotmem("proxy/checker", ap_proxy_lb_workers(), pconf);
> +        if (!slotmem_loc)
> +            slotmem_loc = apr_pstrcat(pconf, ":", proxy_module.name, NULL);
> +
> +        rv = worker_storage->create_slotmem(slotmem_loc, ap_proxy_lb_workers(), pconf);

Sorry for being confused, but in one case you store a (struct proxy_worker_conf) in this slotmemory and
in proxy_util you use the same area to store a proxy_worker_stat entry. So as far as I understand it you
store different structures, with different sizes in the same memory. Does this really work?

Regards

Rüdiger

Re: svn commit: r428437 - /httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c

Posted by Jean-frederic Clere <jf...@gmail.com>.
Ruediger Pluem wrote:

>On 08/03/2006 06:01 PM, jfclere@apache.org wrote:
>  
>
>>Author: jfclere
>>Date: Thu Aug  3 09:01:50 2006
>>New Revision: 428437
>>
>>URL: http://svn.apache.org/viewvc?rev=428437&view=rev
>>Log:
>>Use only one slotmem for status and checker.
>>
>>Modified:
>>    httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c
>>
>>Modified: httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c
>>URL: http://svn.apache.org/viewvc/httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c?rev=428437&r1=428436&r2=428437&view=diff
>>==============================================================================
>>--- httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c (original)
>>+++ httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c Thu Aug  3 09:01:50 2006
>>@@ -40,13 +40,19 @@
>> {
>>     const health_worker_method *worker_storage;
>>     worker_storage = ap_lookup_provider(PROXY_CKMETHOD, "default", "0");
>>+    proxy_server_conf *sconf = ap_get_module_config(s->module_config,
>>+                                                    &proxy_module);
>>+    char *slotmem_loc = sconf->slotmem_loc;
>>     
>>     if (worker_storage) {
>>         apr_status_t rv;
>>-        rv = worker_storage->create_slotmem("proxy/checker", ap_proxy_lb_workers(), pconf);
>>+        if (!slotmem_loc)
>>+            slotmem_loc = apr_pstrcat(pconf, ":", proxy_module.name, NULL);
>>+
>>+        rv = worker_storage->create_slotmem(slotmem_loc, ap_proxy_lb_workers(), pconf);
>>    
>>
>
>Sorry for being confused, but in one case you store a (struct proxy_worker_conf) in this slotmemory and
>in proxy_util you use the same area to store a proxy_worker_stat entry. So as far as I understand it you
>store different structures, with different sizes in the same memory. Does this really work?
>  
>
+++
jfclere@jfcexpert:~/httpd-proxy-scoreboard/modules/proxy$ grep 
ap_slotmem_create *.c
health_checker_util.c:    rv = checkstorage->ap_slotmem_create(&myscore, 
name, sizeof(struct proxy_worker_conf), item_num, pool);
proxy_util.c:        storage->ap_slotmem_create(&myscore, slotmem_loc, 
sizeof(proxy_worker_stat), ap_proxy_lb_workers(), pconf);
+++
That looks wrong, but if you look in ap_slotmem_create you will see that 
it first looks to the slotmems already created and only checks the name.
Of course that only works because the struct proxy_worker_conf first 
element is a proxy_worker_stat.

Cheers

Jean-Frederic

>Regards
>
>Rüdiger
>
>  
>


Re: svn commit: r428437 - /httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c

Posted by Jean-frederic Clere <jf...@gmail.com>.
Ruediger Pluem wrote:

>On 08/03/2006 06:01 PM, jfclere@apache.org wrote:
>  
>
>>Author: jfclere
>>Date: Thu Aug  3 09:01:50 2006
>>New Revision: 428437
>>
>>URL: http://svn.apache.org/viewvc?rev=428437&view=rev
>>Log:
>>Use only one slotmem for status and checker.
>>
>>Modified:
>>    httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c
>>
>>Modified: httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c
>>URL: http://svn.apache.org/viewvc/httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c?rev=428437&r1=428436&r2=428437&view=diff
>>==============================================================================
>>--- httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c (original)
>>+++ httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c Thu Aug  3 09:01:50 2006
>>@@ -40,13 +40,19 @@
>> {
>>     const health_worker_method *worker_storage;
>>     worker_storage = ap_lookup_provider(PROXY_CKMETHOD, "default", "0");
>>+    proxy_server_conf *sconf = ap_get_module_config(s->module_config,
>>+                                                    &proxy_module);
>>+    char *slotmem_loc = sconf->slotmem_loc;
>>     
>>     if (worker_storage) {
>>         apr_status_t rv;
>>-        rv = worker_storage->create_slotmem("proxy/checker", ap_proxy_lb_workers(), pconf);
>>+        if (!slotmem_loc)
>>+            slotmem_loc = apr_pstrcat(pconf, ":", proxy_module.name, NULL);
>>+
>>+        rv = worker_storage->create_slotmem(slotmem_loc, ap_proxy_lb_workers(), pconf);
>>    
>>
>
>Sorry for being confused, but in one case you store a (struct proxy_worker_conf) in this slotmemory and
>in proxy_util you use the same area to store a proxy_worker_stat entry. So as far as I understand it you
>store different structures, with different sizes in the same memory. Does this really work?
>  
>
This works, but there is another problem (also in trunk) that I have not 
solved yet:
- in httpd.conf change the workers (add one in top for example).
- make graceful restart
- go to /server-status/
The information about workers (Access/Read/Write) is wrong. With the 
persistance I have added you have to remove the *.slotmem file to 
arrange it, in trunk a stop and a start helps.
To solve that I am thinking of using ap_md5_binary on the worker_conf list.

Comments?

Cheers

Jean-Frederic

>Regards
>
>Rüdiger
>
>  
>