httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mladen Turk <>
Subject Re: mod_slotmem and mod_proxy_balancer/others on win32 (PR52402)
Date Fri, 03 Feb 2012 13:03:15 GMT
On 02/03/2012 11:46 AM, Jim Jagielski wrote:
> On Feb 3, 2012, at 4:25 AM, Mladen Turk wrote:
>> Hi,
>> mod_slotmem cannot work on windows by design.
>> On windows we have two processes so the storage->grab/slotmem_grab
>> will always fail because the inuse flag was already set in the parent,
>> and since this is shared memory child will see it as used.
>> On unixes fork is used so the inuse is set only once.
> I'm trying to understand this... how is this different from any of
> the other mpms which also have at least 2 processes?

Right, seems that's not the reason for PR52402.
Found the fix for it. The reason is the loop:

     while (s) {
         int i,j;
         proxy_balancer *balancer;
         sconf = s->module_config;
         conf = (proxy_server_conf *)ap_get_module_config(sconf, &proxy_module);

         /* adding ... */
         if (conf->bslot) {
             /* We already have shared memory storage created for this server_rec.
              * Skip second invocation because there are no more space left in
              * the shm so the storage->grab() will fail.
             s = s->next;

Fixes the issue, although I'm not sure that's the correct solution.
Shared memory id uses vhost name for key, and think it should use
vhost:port combination instead.

However I might be wrong and the upper patch is all that's needed
if the balancer is shared between multiple server_rec's


View raw message