Re: AW: Config Bug in proxy_balancer?

2006-03-28 Thread Jim Jagielski
=?iso-8859-1?Q?Pl=FCm=2C_R=FCdiger=2C_VIS?= wrote:
 
 
 
  -Urspr=FCngliche Nachricht-
  Von: Jim Jagielski
to do here.
  =20
   Ok, but this actually works already without your patch.
 =20
  I never even bothered to check... Brian's initial
  Email said that it didn't. Are you saying that his Email
  is wrong and that balancers defined in the main server
  conf via Proxy, as well as their workers, ARE fully
  inherited by Vhosts?
 
 As far as I saw in my very limited tests: Yes.
 This does also match with my code analysis I did in one
 of my previous mails (the one with the 'correct me if I am wrong').
 Of course there remain other weird things that are not nice
 (e.g. the empty balancer created by the VHOST, the fact that the
 empty balancer is not used because it comes later in the array)
 

Then I'm confused on what the actual problem is then. And shame on
me for not trying to recreate the bug first before trying to
fix it :) We *do* after all merge and append the workers and
balancers. I just assumed that one issue was not creating
the balancer immediately and waiting for ProxyPass and/or
BalancerMember.
-- 
===
   Jim Jagielski   [|]   [EMAIL PROTECTED]   [|]   http://www.jaguNET.com/
If you can dodge a wrench, you can dodge a ball.


Re: AW: Config Bug in proxy_balancer?

2006-03-27 Thread Jim Jagielski


On Mar 23, 2006, at 9:59 AM, Plüm, Rüdiger, VIS wrote:





-Ursprüngliche Nachricht-
Von: Jim Jagielski


I want to be able to use same balancer in multiple vhosts.



This is actually that way by design, iirc. I've no
real issues with it being Vhost specific or inheritable.
So if others think it's worthwhile having the above
functionality, I'm +1 for it and would work on something
to implement that.


+1 makes sense.



Something like this maybe? Of course, since it's inherited,
the balancer shows up twice in the balancer-manager, but
maybe that make sense :)

Index: modules/proxy/mod_proxy.c
===
--- modules/proxy/mod_proxy.c   (revision 389138)
+++ modules/proxy/mod_proxy.c   (working copy)
@@ -1625,6 +1625,19 @@
 conf = ap_set_config_vectors(cmd-server, new_dir_conf, cmd-path,
  proxy_module, cmd-pool);
+if (strncasecmp(cmd-path, balancer:, 9) == 0) {
+   proxy_server_conf *sconf =
+	 (proxy_server_conf *) ap_get_module_config(cmd-server- 
module_config, proxy_module);
+proxy_balancer *balancer = ap_proxy_get_balancer(cmd-pool,  
sconf, cmd-path);

+if (!balancer) {
+const char *err = ap_proxy_add_balancer(balancer,
+cmd-pool,
+sconf, cmd-path);
+if (err)
+return apr_pstrcat(cmd-temp_pool, Proxy , err,  
NULL);

+}
+}
+
 errmsg = ap_walk_config(cmd-directive-first_child, cmd,  
new_dir_conf);

 if (errmsg != NULL)
 return errmsg;



Re: AW: Config Bug in proxy_balancer?

2006-03-27 Thread Jim Jagielski


On Mar 27, 2006, at 10:27 AM, Brian Akins wrote:


Jim Jagielski wrote:


Something like this maybe? Of course, since it's inherited,
the balancer shows up twice in the balancer-manager, but
maybe that make sense :)


Shouldn't it just appear once?  That's just my thinking...



Well, there *are* 2 balancers... but yeah, it is quite
confusing, and there are things that need to be
further addressed here. But we could commit as-is
and tune as we go ;)


Re: AW: Config Bug in proxy_balancer?

2006-03-27 Thread Brian Akins

Jim Jagielski wrote:


Well, there *are* 2 balancers... but yeah, it is quite
confusing, and there are things that need to be
further addressed here. 


I'm think of what if someone had a script that parses the 
balancer-manager output.  it would be very confusing to figure out which 
is the correct balancer.


Any reason we can't have the limitation that balancer names must be unique?


--
Brian Akins
Lead Systems Engineer
CNN Internet Technologies


Re: AW: Config Bug in proxy_balancer?

2006-03-27 Thread Jim Jagielski
Brian Akins wrote:
 
 Jim Jagielski wrote:
 
  Well, there *are* 2 balancers... but yeah, it is quite
  confusing, and there are things that need to be
  further addressed here. 
 
 I'm think of what if someone had a script that parses the 
 balancer-manager output.  it would be very confusing to figure out which 
 is the correct balancer.
 
 Any reason we can't have the limitation that balancer names must be unique?
 

I don't see why not. But the reason for the double is even
deeper than that. You see, the balancer is defined at the
main server config rec. When each Vhost is merged, they
grab a copy of the main server's balancer config setup.
So you have 2 balancers, one of which isn't used at
all (the main server's) and one that is.

-- 
===
   Jim Jagielski   [|]   [EMAIL PROTECTED]   [|]   http://www.jaguNET.com/
If you can dodge a wrench, you can dodge a ball.


Re: AW: Config Bug in proxy_balancer?

2006-03-27 Thread Brian Akins

Jim Jagielski wrote:
 When each Vhost is merged, they

grab a copy of the main server's balancer config setup.
So you have 2 balancers, one of which isn't used at
all (the main server's) and one that is.



my very silly global_balancers patch fixes that.


--
Brian Akins
Lead Systems Engineer
CNN Internet Technologies


Re: AW: Config Bug in proxy_balancer?

2006-03-27 Thread Jim Jagielski
Brian Akins wrote:
 
 Jim Jagielski wrote:
   When each Vhost is merged, they
  grab a copy of the main server's balancer config setup.
  So you have 2 balancers, one of which isn't used at
  all (the main server's) and one that is.
  
 
 my very silly global_balancers patch fixes that.
 

Yes, making them all global avoids that, but has the nasty
side-effect, as mentioned, that balancers defined in one Vhost
leak into others... Looking into ways of better handling the
inheritance, but anyone have serious comments about committing
the patch and working from there?

-- 
===
   Jim Jagielski   [|]   [EMAIL PROTECTED]   [|]   http://www.jaguNET.com/
If you can dodge a wrench, you can dodge a ball.


Re: AW: Config Bug in proxy_balancer?

2006-03-27 Thread Ruediger Pluem


On 03/27/2006 05:15 PM, Jim Jagielski wrote:
 
 On Mar 23, 2006, at 9:59 AM, Plüm, Rüdiger, VIS wrote:
 


 -Ursprüngliche Nachricht-
 Von: Jim Jagielski


 I want to be able to use same balancer in multiple vhosts.


 This is actually that way by design, iirc. I've no
 real issues with it being Vhost specific or inheritable.
 So if others think it's worthwhile having the above
 functionality, I'm +1 for it and would work on something
 to implement that.


 +1 makes sense.

 
 Something like this maybe? Of course, since it's inherited,
 the balancer shows up twice in the balancer-manager, but
 maybe that make sense :)
 
 Index: modules/proxy/mod_proxy.c
 ===
 --- modules/proxy/mod_proxy.c(revision 389138)
 +++ modules/proxy/mod_proxy.c(working copy)
 @@ -1625,6 +1625,19 @@
  conf = ap_set_config_vectors(cmd-server, new_dir_conf, cmd-path,
   proxy_module, cmd-pool);
 +if (strncasecmp(cmd-path, balancer:, 9) == 0) {
 +proxy_server_conf *sconf =
 + (proxy_server_conf *) ap_get_module_config(cmd-server-
module_config, proxy_module);
 +proxy_balancer *balancer = ap_proxy_get_balancer(cmd-pool, 
 sconf, cmd-path);
 +if (!balancer) {
 +const char *err = ap_proxy_add_balancer(balancer,
 +cmd-pool,
 +sconf, cmd-path);
 +if (err)
 +return apr_pstrcat(cmd-temp_pool, Proxy , err, 
 NULL);
 +}
 +}
 +
  errmsg = ap_walk_config(cmd-directive-first_child, cmd, 
 new_dir_conf);
  if (errmsg != NULL)
  return errmsg;
 

Sorry for being somewhat lost, but currently I struggle to understand what this
patch actually does. So I try to explain what I understood so far. Please 
correct
me if I am wrong :-).

If the path of a Proxy block starts with balancer: and this balancer isn't 
already
in the server config you add it. The same would happen with todays code provided
that the Proxy block contains at least one BalancerMember directive (an 
assumption
which seems to make sense to me).

Currently I do not see how this changes the following configuration problem:

Proxy balancer://fill
BalancerMember http://server1:80 route=server1
BalancerMember http://server2:80 route=server2
/Proxy

VirtualHost *
...
ProxyPass /path balancer://fill/ stickysession=Sticky

/VirtualHost

Because with old and new code a balancer called fill with 2 members gets added 
to the
main server config.

The ProxyPass directive in the virtualhost causes another balancer called fill 
added
to the (then empty) conf-balancers array of this virtual host configuration.
Afterwards both configurations get merged and we have two balancers called fill
in the merged array conf-balancers for this virtual host: One that is inherited
from the main server with 2 members (and actually is the same balancer as the 
one
in the main server) and one empty that got created by ProxyPass inside the 
virtual
host. Actually the configuration works because during request processing
ap_proxy_get_balancer starts searching at the beginning of the conf-balancers
array and thus finds the non empty balancer. If I go somewhat further with my 
thoughts
and have a look at the following configuration

Proxy balancer://fill
BalancerMember http://server1:80 route=server1
BalancerMember http://server2:80 route=server2
/Proxy

VirtualHost A
...
ProxyPass /path balancer://fill/ stickysession=Sticky

/VirtualHost
VirtualHost B
...
ProxyPass /path balancer://fill/ stickysession=Sticky

/VirtualHost

Then according to my thoughts virtualhost A and B would effectively share the
balancer from the main server. As far as I understood this is a situation
you wanted to avoid.

But as said I am not an expert on these configuration issue, so this maybe
all wrong :-). If yes, please give me a hint where I missed the train.

Regards

Rüdiger


Re: AW: Config Bug in proxy_balancer?

2006-03-27 Thread Brian Akins

Ruediger Pluem wrote:


Proxy balancer://fill
BalancerMember http://server1:80 route=server1
BalancerMember http://server2:80 route=server2
/Proxy

VirtualHost A
...
ProxyPass /path balancer://fill/ stickysession=Sticky

/VirtualHost
VirtualHost B
...
ProxyPass /path balancer://fill/ stickysession=Sticky

/VirtualHost

Then according to my thoughts virtualhost A and B would effectively 
share the

balancer from the main server. As far as I understood this is a situation
you wanted to avoid.


I want them to share the balancer.  Currently, they do not fully.

Or have I confused my self...

--
Brian Akins
Lead Systems Engineer
CNN Internet Technologies


Re: AW: Config Bug in proxy_balancer?

2006-03-27 Thread Jim Jagielski


On Mar 27, 2006, at 2:55 PM, Ruediger Pluem wrote:



Proxy balancer://fill
BalancerMember http://server1:80 route=server1
BalancerMember http://server2:80 route=server2
/Proxy

VirtualHost A
...
ProxyPass /path balancer://fill/ stickysession=Sticky

/VirtualHost
VirtualHost B
...
ProxyPass /path balancer://fill/ stickysession=Sticky

/VirtualHost

Then according to my thoughts virtualhost A and B would effectively  
share the
balancer from the main server. As far as I understood this is a  
situation

you wanted to avoid.



What we needed to avoid was the case where a balancer defined in
VhostA leaked into VhostB. You should not be able to define
balancers in one Vhost and have them available in others; it's
certainly a weird regression. Now *inheriting* one from the main
server does make sense, kindof, and that's what we're trying
to do here.


Re: AW: Config Bug in proxy_balancer?

2006-03-27 Thread Jim Jagielski
Brian Akins wrote:
 
 I want them to share the balancer.  Currently, they do not fully.
 
 Or have I confused my self...
 

Nah, I understand perfectly :)

VHosts should have access to any balancer defined at the
main server level. I think we're all in agreement here.
The issue is whether vhosts should be allowed to also share
and have access to balancers in *other* Vhosts. I don't
think they should, that's why making balancers global
does make sense. So we need some level of inheritance
as well as potentially some level of Vhosts looking
at the main server's proxy_conf rec.

-- 
===
   Jim Jagielski   [|]   [EMAIL PROTECTED]   [|]   http://www.jaguNET.com/
If you can dodge a wrench, you can dodge a ball.


Re: AW: Config Bug in proxy_balancer?

2006-03-27 Thread Ruediger Pluem


On 03/27/2006 10:03 PM, Jim Jagielski wrote:


 
 What we needed to avoid was the case where a balancer defined in
 VhostA leaked into VhostB. You should not be able to define
 balancers in one Vhost and have them available in others; it's

That makes things clearer to me. Thanks. BTW: I agree with this.

 certainly a weird regression. Now *inheriting* one from the main
 server does make sense, kindof, and that's what we're trying
 to do here.

Ok, but this actually works already without your patch. We only
face the weird issue right now that an (later) unused empty balancer
with the same name gets created in the vhost.
Next question: How to deal with parameters set for the balancer
via ProxySet? Currently these settings get lost.
OTH it wouldn't make sense to apply them to the balancer
inherited from the main server if do not create a *complete copy*
of this balancer. Ok. Thats enough devils advocate for now :-).


Regards

Rüdiger





Re: AW: Config Bug in proxy_balancer?

2006-03-27 Thread Jim Jagielski
Ruediger Pluem wrote:
 
 
 
 On 03/27/2006 10:03 PM, Jim Jagielski wrote:
 
 
  
  What we needed to avoid was the case where a balancer defined in
  VhostA leaked into VhostB. You should not be able to define
  balancers in one Vhost and have them available in others; it's
 
 That makes things clearer to me. Thanks. BTW: I agree with this.
 
  certainly a weird regression. Now *inheriting* one from the main
  server does make sense, kindof, and that's what we're trying
  to do here.
 
 Ok, but this actually works already without your patch.

I never even bothered to check... Brian's initial
Email said that it didn't. Are you saying that his Email
is wrong and that balancers defined in the main server
conf via Proxy, as well as their workers, ARE fully
inherited by Vhosts?

-- 
===
   Jim Jagielski   [|]   [EMAIL PROTECTED]   [|]   http://www.jaguNET.com/
If you can dodge a wrench, you can dodge a ball.


Re: AW: Config Bug in proxy_balancer?

2006-03-27 Thread Plüm , Rüdiger , VIS


 -Ursprüngliche Nachricht-
 Von: Jim Jagielski
   to do here.
  
  Ok, but this actually works already without your patch.
 
 I never even bothered to check... Brian's initial
 Email said that it didn't. Are you saying that his Email
 is wrong and that balancers defined in the main server
 conf via Proxy, as well as their workers, ARE fully
 inherited by Vhosts?

As far as I saw in my very limited tests: Yes.
This does also match with my code analysis I did in one
of my previous mails (the one with the 'correct me if I am wrong').
Of course there remain other weird things that are not nice
(e.g. the empty balancer created by the VHOST, the fact that the
empty balancer is not used because it comes later in the array)

Regards

Rüdiger



Re: AW: Config Bug in proxy_balancer?

2006-03-24 Thread Jim Jagielski

I'm not sure if balancers defined in VHost sections
should be available globally. I'm much more comfy
with top level balancers being inherited by
VHosts (bubbling down) but not bubbling up or over :)

Would that match what you're looking for?

On Mar 23, 2006, at 12:10 PM, Akins, Brian wrote:



Here's a really simple patch that just makes the balancers global  
rather

than per server...

--
Brian Akins
Lead Systems Engineer
CNN Internet Technologies

global_balancers.patch




Re: AW: Config Bug in proxy_balancer?

2006-03-24 Thread Brian Akins

Jim Jagielski wrote:


Would that match what you're looking for?


Yes.  Wasn't sure how to word it.  The issue is, I think, that add_pass 
gets ran before megre.



--
Brian Akins
Lead Systems Engineer
CNN Internet Technologies


Re: AW: Config Bug in proxy_balancer?

2006-03-24 Thread Jim Jagielski
Brian Akins wrote:
 
 Jim Jagielski wrote:
 
  Would that match what you're looking for?
 
 Yes.  Wasn't sure how to word it.  The issue is, I think, that add_pass 
 gets ran before megre.
 

Yeah... need to look into how to do it without making the
whole shebang global. I have some cycles this weekend...

-- 
===
   Jim Jagielski   [|]   [EMAIL PROTECTED]   [|]   http://www.jaguNET.com/
If you can dodge a wrench, you can dodge a ball.


AW: Config Bug in proxy_balancer?

2006-03-23 Thread Plüm , Rüdiger , VIS


 -Ursprüngliche Nachricht-
 Von: Jim Jagielski 
 
  I want to be able to use same balancer in multiple vhosts.
 
 
 This is actually that way by design, iirc. I've no
 real issues with it being Vhost specific or inheritable.
 So if others think it's worthwhile having the above
 functionality, I'm +1 for it and would work on something
 to implement that.

+1 makes sense.

Regards

Rüdiger
 


Config Bug in proxy_balancer?

2006-03-22 Thread Akins, Brian
This works:

VirtualHost *
...
Proxy balancer://fill
BalancerMember http://server1:80 route=server1
BalancerMember http://server2:80 route=server2
/Proxy

ProxyPass /path balancer://fill/ stickysession=Sticky

/VirtualHost


This does not:

  Proxy balancer://fill
BalancerMember http://server1:80 route=server1
BalancerMember http://server2:80 route=server2
/Proxy

VirtualHost *
...
ProxyPass /path balancer://fill/ stickysession=Sticky

/VirtualHost



I want to be able to use same balancer in multiple vhosts.



Re: Config Bug in proxy_balancer?

2006-03-22 Thread Sander Temme


On Mar 22, 2006, at 7:58 AM, Akins, Brian wrote:


I want to be able to use same balancer in multiple vhosts.


Looks like something doesn't get inherited. Have a peek at the merge  
functions for the structure(s) that affect this behaviour.


S.

smime.p7s
Description: S/MIME cryptographic signature


Re: Config Bug in proxy_balancer?

2006-03-22 Thread Akins, Brian


On 3/22/06 11:39 AM, Sander Temme [EMAIL PROTECTED] wrote:

 Looks like something doesn't get inherited. Have a peek at the merge
 functions for the structure(s) that affect this behaviour.
 
 S.

Looks like it may be in add_pass where it calls ap_proxy_get_balancer:

 if (strncasecmp(r, balancer:, 9) == 0) {
proxy_balancer *balancer = ap_proxy_get_balancer(cmd-pool, conf,
r);
if (!balancer) {
const char *err = ap_proxy_add_balancer(balancer,
cmd-pool,
conf, r);
if (err)
return apr_pstrcat(cmd-temp_pool, ProxyPass , err, NULL);
}

get_balancer looks to return Null. So conf is somehow not merged correctly?

Should conf-balancers be global, rather than per server?

-- 
Brian Akins
Lead Systems Engineer
CNN Internet Technologies 



Re: Config Bug in proxy_balancer?

2006-03-22 Thread Ruediger Pluem


On 03/22/2006 06:32 PM, Akins, Brian wrote:

 
 
 Looks like it may be in add_pass where it calls ap_proxy_get_balancer:
 
  if (strncasecmp(r, balancer:, 9) == 0) {
 proxy_balancer *balancer = ap_proxy_get_balancer(cmd-pool, conf,
 r);
 if (!balancer) {
 const char *err = ap_proxy_add_balancer(balancer,
 cmd-pool,
 conf, r);
 if (err)
 return apr_pstrcat(cmd-temp_pool, ProxyPass , err, NULL);
 }
 
 get_balancer looks to return Null. So conf is somehow not merged correctly?

I am not an expert on these configuration things, but is it possible that the
config will be merged *after* add_pass had been run?

proxy_server_conf *conf =
(proxy_server_conf *) ap_get_module_config(s-module_config, proxy_module);

a few lines up seems to get the configuration for this virtual host, but I guess
it does not contain the balancer definitions made in the main server at this 
point of
time.

Regards

Rüdiger



Bug in proxy_balancer?

2006-03-21 Thread Brian Akins

This works:

VirtualHost *
...
Proxy balancer://fill
BalancerMember http://server1:80 route=server1
BalancerMember http://server2:80 route=server2
/Proxy

ProxyPass /path balancer://fill/ stickysession=Sticky   

/VirtualHost


This does not:

  Proxy balancer://fill
BalancerMember http://server1:80 route=server1
BalancerMember http://server2:80 route=server2
/Proxy

VirtualHost *
...
ProxyPass /path balancer://fill/ stickysession=Sticky   

/VirtualHost



I want to be able to use same balancer in multiple vhosts.

--
Brian Akins
Lead Systems Engineer
CNN Internet Technologies


Bug in proxy_balancer?

2006-03-21 Thread Brian Akins

got bounced?

 Original Message 
Subject: Bug in proxy_balancer?
Date: Tue, 21 Mar 2006 14:18:07 -0500
From: Brian Akins [EMAIL PROTECTED]
To: dev@httpd.apache.org

This works:

VirtualHost *
...
Proxy balancer://fill
BalancerMember http://server1:80 route=server1
BalancerMember http://server2:80 route=server2
/Proxy

ProxyPass /path balancer://fill/ stickysession=Sticky   

/VirtualHost


This does not:

  Proxy balancer://fill
BalancerMember http://server1:80 route=server1
BalancerMember http://server2:80 route=server2
/Proxy

VirtualHost *
...
ProxyPass /path balancer://fill/ stickysession=Sticky   

/VirtualHost



I want to be able to use same balancer in multiple vhosts.

--
Brian Akins
Lead Systems Engineer
CNN Internet Technologies


--
Brian Akins
Lead Systems Engineer
CNN Internet Technologies