You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rainer Jung <ra...@kippdata.de> on 2012/12/16 15:51:12 UTC

Re: svn commit: r1422584 - /httpd/httpd/branches/2.4.x/STATUS

On 16.12.2012 15:42, minfrin@apache.org wrote:
> Author: minfrin
> Date: Sun Dec 16 14:42:17 2012
> New Revision: 1422584
> 
> URL: http://svn.apache.org/viewvc?rev=1422584&view=rev
> Log:
> Add a comment.
> 
> Modified:
>     httpd/httpd/branches/2.4.x/STATUS
> 
> Modified: httpd/httpd/branches/2.4.x/STATUS
> URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1422584&r1=1422583&r2=1422584&view=diff
> ==============================================================================
> --- httpd/httpd/branches/2.4.x/STATUS (original)
> +++ httpd/httpd/branches/2.4.x/STATUS Sun Dec 16 14:42:17 2012
> @@ -118,6 +118,12 @@ PATCHES PROPOSED TO BACKPORT FROM TRUNK:
>       2.4.x patch: http://people.apache.org/~jim/patches/proxypassinherit2.patch
>       +1: jim, druggeri
>       +1: rjung, if r1421912 is also added (see below)
> +     minfrin: In the current form, if inherit is disabled any attempt
> +              at setting any directive silently unsets an arbitrary
> +              selection of other proxy directives at the same time,
> +              causing much confusion. Each override should have an
> +              independent "_set" flag to indicate which are being
> +              consciously overridden, and which aren't.

Graham, can you give an example? I don't get the "any attempt at setting
any directive silently unsets an arbitrary selection of other proxy
directives at the same time".

Clearly after the change there are two types of proxy directives, one
type is always merged, because they are more general proxy settings, the
other type is only merged if inherit is On. Which directive should be in
which group is surely debatable and should of course be documented. But
your statement about setting anything silently unsets something else is
unclear to me.

Regards,

Rainer


Re: svn commit: r1422584 - /httpd/httpd/branches/2.4.x/STATUS

Posted by Jim Jagielski <ji...@jaguNET.com>.
The only time this needs to be off is when using the Balancer
Manager to adjust Balancers and Workers... As such, I think I
was a bit over-eager in what conf-> fields needed to be worried
about.

Here's the problem:
If a balancer is defined in the top-level server, then it
is inherited by all vhosts. But balancers themselves are
server-specific. Normally, this makes no difference, but
when dynamically changing balancer and worker parameters,
you want to be able to ensure that you are only changing
the params for a specific balancer/worker associated with
that particular server (vhost) and not for "everyone",
which is the potential since those params are stored in
shared mem. By ensuring that each server has their own
"private" set of balancers and workers, we avoid the
problem.

On Dec 17, 2012, at 5:03 AM, Graham Leggett <mi...@sharp.fm> wrote:

> On 17 Dec 2012, at 11:23 AM, Rainer Jung <ra...@kippdata.de> wrote:
> 
>> That's the whole purpose of the "ProxyPassInherit Off" setting. If you
>> switch the global setting from "On" to "Off", then global proxy targets
>> and workers are not merged to any vhost. If you switch to "Off" only in
>> a VHost, then only that VHost does not inherit (merge) the globally
>> defined ones. If you switch to "Off" globally but again to "On" in a
>> VHost, then only those VHosts will inherit.
> 
> Ok, I see this now, but only after reading the above paragraph three times and the code a few times more.
> 
> This is a special edge case that goes against the typical behaviour of all the other directives in the server, and as a result will confuse the life out of any admin who hasn't seen this before. The documentation at http://httpd.apache.org/docs/trunk/mod/mod_proxy.html#proxypassinherit needs to define two things:
> 
> - An accurate list of the exact directives affected by this directive. "ProxyPass Balancers and Workers" is not accurate enough.
> 
> - An accurate description of the "issues and inconsistent behaviour" that the admin is likely to experience if they don't turn this directive off.
> 
> The admin is probably going to find this directive after searching for a problem in google, we need to make sure that google search is going to lead directly to this directive.
> 
> Regards,
> Graham
> --
> 


Re: svn commit: r1422584 - /httpd/httpd/branches/2.4.x/STATUS

Posted by Graham Leggett <mi...@sharp.fm>.
On 17 Dec 2012, at 11:23 AM, Rainer Jung <ra...@kippdata.de> wrote:

> That's the whole purpose of the "ProxyPassInherit Off" setting. If you
> switch the global setting from "On" to "Off", then global proxy targets
> and workers are not merged to any vhost. If you switch to "Off" only in
> a VHost, then only that VHost does not inherit (merge) the globally
> defined ones. If you switch to "Off" globally but again to "On" in a
> VHost, then only those VHosts will inherit.

Ok, I see this now, but only after reading the above paragraph three times and the code a few times more.

This is a special edge case that goes against the typical behaviour of all the other directives in the server, and as a result will confuse the life out of any admin who hasn't seen this before. The documentation at http://httpd.apache.org/docs/trunk/mod/mod_proxy.html#proxypassinherit needs to define two things:

- An accurate list of the exact directives affected by this directive. "ProxyPass Balancers and Workers" is not accurate enough.

- An accurate description of the "issues and inconsistent behaviour" that the admin is likely to experience if they don't turn this directive off.

The admin is probably going to find this directive after searching for a problem in google, we need to make sure that google search is going to lead directly to this directive.

Regards,
Graham
--


Re: svn commit: r1422584 - /httpd/httpd/branches/2.4.x/STATUS

Posted by Rainer Jung <ra...@kippdata.de>.
On 17.12.2012 09:53, Graham Leggett wrote:
> On 16 Dec 2012, at 4:51 PM, Rainer Jung <ra...@kippdata.de> wrote:
> 
>> Graham, can you give an example? I don't get the "any attempt at setting
>> any directive silently unsets an arbitrary selection of other proxy
>> directives at the same time".
> 
> Take a look at this code specifically:
> 
> +    else {
> +        ps->proxies = overrides->proxies;
> +        ps->sec_proxy = overrides->sec_proxy;
> +        ps->aliases = overrides->aliases;
> +        ps->noproxies = overrides->noproxies;
> +        ps->dirconn = overrides->dirconn;
> +        ps->workers = overrides->workers;
> +        ps->balancers = overrides->balancers;
> +    }
> 
> The above code resets seven proxy directives to their default values, whether they have been overridden by the administrator or not. There is no merge going on at all. As a result, an administrator that adds any unrelated global scoped proxy directive causes the above seven directives to disappear as a side effect, without warning or reason.

That's the whole purpose of the "ProxyPassInherit Off" setting. If you
switch the global setting from "On" to "Off", then global proxy targets
and workers are not merged to any vhost. If you switch to "Off" only in
a VHost, then only that VHost does not inherit (merge) the globally
defined ones. If you switch to "Off" globally but again to "On" in a
VHost, then only those VHosts will inherit.

I still don't understand "an administrator that adds any unrelated
global scoped proxy directive causes the above seven directives to
disappear". The merging is only turned off (directives disappear), if
the administrator adds "ProxyPassInherit Off", and that's not any
unrelated directive. The whole purpose of that directive is turning the
merging of.

I think Jim originally had a technical reason related to the balancer
manager for this. I didn't check that reasoning, but from my own
experience, ProxyPass and similar are often related to specific vhosts,
so defining a global ProxyPass and then having it automatically in every
VHost can be quite a surprise. I agree that this change is disruptive,
but that's why we made the default still behaving like before (merge
everything).

Regards,

Rainer

Re: svn commit: r1422584 - /httpd/httpd/branches/2.4.x/STATUS

Posted by Graham Leggett <mi...@sharp.fm>.
On 16 Dec 2012, at 4:51 PM, Rainer Jung <ra...@kippdata.de> wrote:

> Graham, can you give an example? I don't get the "any attempt at setting
> any directive silently unsets an arbitrary selection of other proxy
> directives at the same time".

Take a look at this code specifically:

+    else {
+        ps->proxies = overrides->proxies;
+        ps->sec_proxy = overrides->sec_proxy;
+        ps->aliases = overrides->aliases;
+        ps->noproxies = overrides->noproxies;
+        ps->dirconn = overrides->dirconn;
+        ps->workers = overrides->workers;
+        ps->balancers = overrides->balancers;
+    }

The above code resets seven proxy directives to their default values, whether they have been overridden by the administrator or not. There is no merge going on at all. As a result, an administrator that adds any unrelated global scoped proxy directive causes the above seven directives to disappear as a side effect, without warning or reason.

In contrast, the following performs a merge:

    ps->recv_buffer_size = (overrides->recv_buffer_size_set == 0) ? base->recv_buffer_size : overrides->recv_buffer_size;
    ps->recv_buffer_size_set = overrides->recv_buffer_size_set || base->recv_buffer_size_set;

This is an alternative merge, where we consider the override value unset (and therefore no merge) if it is NULL:

    ps->forward = overrides->forward ? overrides->forward : base->forward;
    ps->reverse = overrides->reverse ? overrides->reverse : base->reverse;

Regards,
Graham
--