You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Yann Ylavic <yl...@gmail.com> on 2014/01/24 00:35:39 UTC

ap_proxy_determine_connection() made simpler?

H
i,

I'm currently working on a patch to be able to configure the lifetime (TTL)
of mod_proxy's DNS lookups (I know about graceful restarts, but that's not
always an option).

I'll propose it when it'll work (al least for me), should it be of any
interest.

The modified code is mainly in ap_proxy_determine_connection (that's why I
may look picky about your UDS' modifications there Jim ;)

No offense, ap_proxy_determine_connection() is quite hard to follow
regarding the init/reuse of connection's hostname/uds_path/address (when
[and where] to do [single] DNS lookups) depending on worker's params and/or
forward/reverse/UDS...
My point is not (at all) to blame anyone (of course, keep the good work!),
I guess the reason is that it has been adapted progressively with new
features/fixes, as always.

I propose the following/attached patch, which rearranges the code in this
way :

- UDS branch first where all relative (specific) inits/reuses are done, or
else

- hostname+port init/reuse (respectively if NULL or not, since they are
always cleared on cleanup if not reusable), and then
- address (single)lookup/reuse depending solely on worker's params
(is_address_reusable/disablereuse).

All the (possible) paths look identical to the previous ones, but these
different actions are not mixed together as before, hence IMHO the code is
clearer (and better fits my needs, although it's not necessarily your
concern).

Maybe I should propose this when

my patch is
fully 
booked (and so is UDS), but since the code there is still hot, it looks
like a good reason to refactor it a bit.
I just take my chance...

Regards,
Yann.

Index: modules/proxy/proxy_util.c
===================================================================
--- modules/proxy/proxy_util.c    (revision 1560806)
+++ modules/proxy/proxy_util.c    (working copy)
@@ -2218,11 +2218,23 @@ ap_proxy_determine_connection(apr_pool_t *p, reque
                          uri->scheme, uds_path);

         }
+        /*
+         * In UDS cases, some structs are NULL. Protect from de-refs
+         * and provide info for logging at the same time.
+         */
+        if (!conn->addr) {
+            apr_sockaddr_t *sa;
+            apr_sockaddr_info_get(&sa, NULL, APR_UNSPEC, 0, 0, conn->pool);
+            conn->addr = sa;
+        }
+        conn->hostname = "httpd-UDS";
+        conn->port = 0;
     }
-    if (!(uds_path) &&
-        (!conn->hostname || !worker->s->is_address_reusable ||
-        worker->s->disablereuse)) {
-        if (proxyname) {
+    else {
+        if (conn->hostname) {
+            /* reuse hostname and port */
+        }
+        else if (proxyname) {
             conn->hostname = apr_pstrdup(conn->pool, proxyname);
             conn->port = proxyport;
             /*
@@ -2258,9 +2270,7 @@ ap_proxy_determine_connection(apr_pool_t *p, reque
             conn->hostname = apr_pstrdup(conn->pool, uri->hostname);
             conn->port = uri->port;
         }
-        socket_cleanup(conn);
-        if (!(*worker->s->uds_path) &&
-            (!worker->s->is_address_reusable || worker->s->disablereuse)) {
+        if (!worker->s->is_address_reusable || worker->s->disablereuse) {
             /*
              * Only do a lookup if we should not reuse the backend address.
              * Otherwise we will look it up once for the worker.
@@ -2269,29 +2279,18 @@ ap_proxy_determine_connection(apr_pool_t *p, reque
                                         conn->hostname, APR_UNSPEC,
                                         conn->port, 0,
                                         conn->pool);
+            /* Ask to close the socket below */
+            conn->close = 1;
         }
-    }
-    else {
         /*
-         * In UDS cases, some structs are NULL. Protect from de-refs
-         * and provide info for logging at the same time.
-         */
-        apr_sockaddr_t *sa;
-        apr_sockaddr_info_get(&sa, NULL, APR_UNSPEC, 0, 0, conn->pool);
-        conn->hostname = "httpd-UDS";
-        conn->addr = sa;
-    }
-    if (!(uds_path) && worker->s->is_address_reusable &&
!worker->s->disablereuse) {
-        /*
          * Looking up the backend address for the worker only makes sense
if
          * we can reuse the address.
          */
-        if (!worker->cp->addr) {
+        else if (!worker->cp->addr) {
             if ((err = PROXY_THREAD_LOCK(worker)) != APR_SUCCESS) {
                 ap_log_rerror(APLOG_MARK, APLOG_ERR, err, r,
APLOGNO(00945) "lock");
                 return HTTP_INTERNAL_SERVER_ERROR;
             }
-
             /*
              * Worker can have the single constant backend adress.
              * The single DNS lookup is used once per worker.
[EOS]

Re: ap_proxy_determine_connection() made simpler?

Posted by Yann Ylavic <yl...@gmail.com>.
I see, you can't hold your liquor :)
Suppose now you have that ability too, would you choose the uncomfortable
sofa or your soft bed?

Seriously, FWIU (now) is_address_reusable (I was deceived by the name) and
disablereuse concern addr and sock, together.
Doesn't it make sense to disable socket reuse while still reusing the same
address (ie. avoid the DNS lookup per request)?
The other possibility is more questionable, but one may also want to reuse
sockets unless the address has changed (at best every TTL seconds).


On Fri, Jan 24, 2014 at 8:49 PM, Jim Jagielski <ji...@jagunet.com> wrote:

> is_address_reuseable is a flag noting whether or not
> the address has an ability; disablereuse is a setting
> which allows the sysadmin to bypass that setting no matter
> what and, eventually, could be something set/reset in
> real-time via the balancer-manager.
>
> For example, I have a driver's license so "can_jim_drive" is
> TRUE; however, after several shots of Balvenie doublewood 12,
> the "disable_jim_from_driving" should be changed from FALSE to TRUE :)
>
> On Jan 24, 2014, at 12:56 PM, Yann Ylavic <yl...@gmail.com> wrote:
>
> > On Fri, Jan 24, 2014 at 2:07 PM, Jim Jagielski <ji...@jagunet.com> wrote:
> > Hmmm from what I can see, if we have a hostname and the address
> > is re-usable, we do stuff we shouldn't.
> >
> > The patch does nothing in the case you mention (like the original code),
> but I guess you meant "we have a hostnane and the address is *not*
> reusable". In which case the patch does nothing either, whereas the
> original code overwrittes the hostname, close the socket and then issues a
> new DNS lookup.
> >
> > That's indeed more than applying the De Morgan's law, but maybe I can
> explain why this is still a streamlining of the whole connections/adresses
> reuse logic.
> >
> > First let me stress that currently, !is_address_reusable is strictly
> equivalent to disablereuse, they imply the same paths everywhere.
> > Whenever one or the other is in action (!is_address_reusable ||
> disablereuse) the connection *and* address are never reused, and when both
> are not in action (is_address_reusable && !disablereuse) the connection
> *and* address are always reused.
> > Disabling socket reuse only will still issue a DNS lookup for each
> request.
> > Disabling address reuse only will still close the socket when done.
> >
> > Hence there is no distinction between connection and address reuse, the
> 2 flags could be merged into a single one, although it would make sense to
> keep both and make them do what they mean :
> > 1. disablereuse: close the socket on release; ignore the flag on acquire
> (just compare conn->sock with NULL)
> > 2. !is_address_reusable: resolve address on acquire (unconditionnaly),
> and if the socket is reused compare with its address (sockaddr_equal) and
> close it on mismatch; ignore the flag on release (just compare
> conn->hostname/addr with NULL)
> > 3. the current behaviour is implied by 1. and 2. when
> is_address_reusable == !disablereuse
> >
> > Any thoughts?
> >
> > As you can see, my proposed patch is influenced by my current work on
> addresses' lifetime (DNS lookups), for which I feel quite unconfortable
> with the current/mixed "reuse" implementation.
> >
> > Back to the patch then...
> > It indeed assumes that when the hostname is not NULL, the connection
> (address/socket) is reusable (otherwise it would have been cleared/zeroed
> on release).
> > Hence it will never issue a DNS lookup nor socket close in that case
> (not cleared => reusable).
> > Thus, the single/per-request DNS lookup is done only when hostname is
> NULL, and solely depends on worker's reuse parameters.
> > I don't think it breaks anything, unless one (not httpd AFAICT) forces
> conn->hostname to something which is not to be taken into account...
> >
> >
> > r1560979 is my streamlining...
> >
> > Yes, nice De Morgan's law.
> >
> > Do you plan to address my comment regarding conn->hostname's leak on
> http://mail-archives.apache.org/mod_mbox/httpd-dev/201401.mbox/%3CCAKQ1sVPT_-+cndcGH95Pt4AdF30kN6+wjAL3w15QORewapR64g@mail.gmail.com%3E?
> >
> >
> >
> > Thx for the idea
> >
> > Yw. I'll come back with the patch described above (distinct
> socket/address reuse) if it sounds applicable.
> > Comments on this are welcome...
> >
> > Regards,
> > Yann.
> >
>
>

Re: ap_proxy_determine_connection() made simpler?

Posted by Jim Jagielski <ji...@jaguNET.com>.
is_address_reuseable is a flag noting whether or not
the address has an ability; disablereuse is a setting
which allows the sysadmin to bypass that setting no matter
what and, eventually, could be something set/reset in
real-time via the balancer-manager.

For example, I have a driver's license so "can_jim_drive" is
TRUE; however, after several shots of Balvenie doublewood 12,
the "disable_jim_from_driving" should be changed from FALSE to TRUE :)

On Jan 24, 2014, at 12:56 PM, Yann Ylavic <yl...@gmail.com> wrote:

> On Fri, Jan 24, 2014 at 2:07 PM, Jim Jagielski <ji...@jagunet.com> wrote:
> Hmmm from what I can see, if we have a hostname and the address
> is re-usable, we do stuff we shouldn't.
> 
> The patch does nothing in the case you mention (like the original code), but I guess you meant "we have a hostnane and the address is *not* reusable". In which case the patch does nothing either, whereas the original code overwrittes the hostname, close the socket and then issues a new DNS lookup.
> 
> That's indeed more than applying the De Morgan's law, but maybe I can explain why this is still a streamlining of the whole connections/adresses reuse logic.
> 
> First let me stress that currently, !is_address_reusable is strictly equivalent to disablereuse, they imply the same paths everywhere.
> Whenever one or the other is in action (!is_address_reusable || disablereuse) the connection *and* address are never reused, and when both are not in action (is_address_reusable && !disablereuse) the connection *and* address are always reused.
> Disabling socket reuse only will still issue a DNS lookup for each request.
> Disabling address reuse only will still close the socket when done.
> 
> Hence there is no distinction between connection and address reuse, the 2 flags could be merged into a single one, although it would make sense to keep both and make them do what they mean :
> 1. disablereuse: close the socket on release; ignore the flag on acquire (just compare conn->sock with NULL)
> 2. !is_address_reusable: resolve address on acquire (unconditionnaly), and if the socket is reused compare with its address (sockaddr_equal) and close it on mismatch; ignore the flag on release (just compare conn->hostname/addr with NULL)
> 3. the current behaviour is implied by 1. and 2. when is_address_reusable == !disablereuse
> 
> Any thoughts?
> 
> As you can see, my proposed patch is influenced by my current work on addresses' lifetime (DNS lookups), for which I feel quite unconfortable with the current/mixed "reuse" implementation.
> 
> Back to the patch then...
> It indeed assumes that when the hostname is not NULL, the connection (address/socket) is reusable (otherwise it would have been cleared/zeroed on release).
> Hence it will never issue a DNS lookup nor socket close in that case (not cleared => reusable).
> Thus, the single/per-request DNS lookup is done only when hostname is NULL, and solely depends on worker's reuse parameters.
> I don't think it breaks anything, unless one (not httpd AFAICT) forces conn->hostname to something which is not to be taken into account...
> 
>  
> r1560979 is my streamlining...
> 
> Yes, nice De Morgan's law.
> 
> Do you plan to address my comment regarding conn->hostname's leak on http://mail-archives.apache.org/mod_mbox/httpd-dev/201401.mbox/%3CCAKQ1sVPT_-+cndcGH95Pt4AdF30kN6+wjAL3w15QORewapR64g@mail.gmail.com%3E ?
> 
>  
> 
> Thx for the idea
>  
> Yw. I'll come back with the patch described above (distinct socket/address reuse) if it sounds applicable.
> Comments on this are welcome...
> 
> Regards,
> Yann.
> 


Re: ap_proxy_determine_connection() made simpler?

Posted by Yann Ylavic <yl...@gmail.com>.
On Fri, Jan 24, 2014 at 2:07 PM, Jim Jagielski <ji...@jagunet.com> wrote:

> Hmmm from what I can see, if we have a hostname and the address
> is re-usable, we do stuff we shouldn't.
>

The patch does nothing in the case you mention (like the original code),
but I guess you meant "we have a hostnane and the address is *not*
reusable". In which case the patch does nothing either, whereas the
original code overwrittes the hostname, close the socket and then issues a
new DNS lookup.

That's indeed more than applying the De Morgan's law, but maybe I can
explain why this is still a streamlining of the whole connections/adresses
reuse logic.

First let me stress that currently, !is_address_reusable is strictly
equivalent to disablereuse, they imply the same paths everywhere.
Whenever one or the other is in action (!is_address_reusable ||
disablereuse) the connection *and* address are never reused, and when both
are not in action (is_address_reusable && !disablereuse) the connection
*and* address are always reused.
Disabling socket reuse only will still issue a DNS lookup for each request.
Disabling address reuse only will still close the socket when done.

Hence there is no distinction between connection and address reuse, the 2
flags could be merged into a single one, although it would make sense to
keep both and make them do what they mean :
1. disablereuse: close the socket on release; ignore the flag on acquire
(just compare conn->sock with NULL)
2. !is_address_reusable: resolve address on acquire (unconditionnaly), and
if the socket is reused compare with its address (sockaddr_equal) and close
it on mismatch; ignore the flag on release (just compare
conn->hostname/addr with NULL)
3. the current behaviour is implied by 1. and 2. when is_address_reusable
== !disablereuse

Any thoughts?

As you can see, my proposed patch is influenced by my current work on
addresses' lifetime (DNS lookups), for which I feel quite unconfortable
with the current/mixed "reuse" implementation.

Back to the patch then...
It indeed assumes that when the hostname is not NULL, the connection
(address/socket) is reusable (otherwise it would have been cleared/zeroed
on release).
Hence it will never issue a DNS lookup nor socket close in that case (not
cleared => reusable).
Thus, the single/per-request DNS lookup is done only when hostname is NULL,
and solely depends on worker's reuse parameters.
I don't think it breaks anything, unless one (not httpd AFAICT) forces
conn->hostname to something which is not to be taken into account...



> r1560979 is my streamlining...
>

Yes, nice De Morgan's law.

Do you plan to address my comment regarding conn->hostname's leak on
http://mail-archives.apache.org/mod_mbox/httpd-dev/201401.mbox/%3CCAKQ1sVPT_-+cndcGH95Pt4AdF30kN6+wjAL3w15QORewapR64g@mail.gmail.com%3E?



>
> Thx for the idea
>

Yw. I'll come back with the patch described above (distinct
socket/address reuse) if it sounds applicable.
Comments on this are welcome...

Regards,
Yann.

Re: ap_proxy_determine_connection() made simpler?

Posted by Jim Jagielski <ji...@jaguNET.com>.
Hmmm from what I can see, if we have a hostname and the address
is re-usable, we do stuff we shouldn't.

r1560979 is my streamlining...

Thx for the idea
On Jan 24, 2014, at 7:19 AM, Jim Jagielski <ji...@jagunet.com> wrote:

> Let me take a look... if all it doesn't is streamline the
> logic then it makes sense: +1
> 
> On Jan 23, 2014, at 6:35 PM, Yann Ylavic <yl...@gmail.com> wrote:
> 
>> Hi,
>> 
>> I'm currently working on a patch to be able to configure the lifetime (TTL) of mod_proxy's DNS lookups (I know about graceful restarts, but that's not always an option).
>> 
>> I'll propose it when it'll work (al least for me), should it be of any interest.
>> 
>> The modified code is mainly in ap_proxy_determine_connection (that's why I may look picky about your UDS' modifications there Jim ;)
>> 
>> No offense, ap_proxy_determine_connection() is quite hard to follow regarding the init/reuse of connection's hostname/uds_path/address (when [and where] to do [single] DNS lookups) depending on worker's params and/or forward/reverse/UDS...
>> My point is not (at all) to blame anyone (of course, keep the good work!), I guess the reason is that it has been adapted progressively with new features/fixes, as always.
>> 
>> I propose the following/attached patch, which rearranges the code in this way :
>> 
>> - UDS branch first where all relative (specific) inits/reuses are done, or else
>> 
>> - hostname+port init/reuse (respectively if NULL or not, since they are always cleared on cleanup if not reusable), and then
>> - address (single)lookup/reuse depending solely on worker's params (is_address_reusable/disablereuse).
>> 
>> All the (possible) paths look identical to the previous ones, but these different actions are not mixed together as before, hence IMHO the code is clearer (and better fits my needs, although it's not necessarily your concern).
>> 
>> Maybe I should propose this when my patch is fully booked (and so is UDS), but since the code there is still hot, it looks like a good reason to refactor it a bit.
>> I just take my chance...
>> 
>> Regards,
>> Yann.
>> 
>> Index: modules/proxy/proxy_util.c
>> ===================================================================
>> --- modules/proxy/proxy_util.c    (revision 1560806)
>> +++ modules/proxy/proxy_util.c    (working copy)
>> @@ -2218,11 +2218,23 @@ ap_proxy_determine_connection(apr_pool_t *p, reque
>>                          uri->scheme, uds_path);
>> 
>>         }
>> +        /*
>> +         * In UDS cases, some structs are NULL. Protect from de-refs
>> +         * and provide info for logging at the same time.
>> +         */
>> +        if (!conn->addr) {
>> +            apr_sockaddr_t *sa;
>> +            apr_sockaddr_info_get(&sa, NULL, APR_UNSPEC, 0, 0, conn->pool);
>> +            conn->addr = sa;
>> +        }
>> +        conn->hostname = "httpd-UDS";
>> +        conn->port = 0;
>>     }
>> -    if (!(uds_path) &&
>> -        (!conn->hostname || !worker->s->is_address_reusable ||
>> -        worker->s->disablereuse)) {
>> -        if (proxyname) {
>> +    else {
>> +        if (conn->hostname) {
>> +            /* reuse hostname and port */
>> +        }
>> +        else if (proxyname) {
>>             conn->hostname = apr_pstrdup(conn->pool, proxyname);
>>             conn->port = proxyport;
>>             /*
>> @@ -2258,9 +2270,7 @@ ap_proxy_determine_connection(apr_pool_t *p, reque
>>             conn->hostname = apr_pstrdup(conn->pool, uri->hostname);
>>             conn->port = uri->port;
>>         }
>> -        socket_cleanup(conn);
>> -        if (!(*worker->s->uds_path) &&
>> -            (!worker->s->is_address_reusable || worker->s->disablereuse)) {
>> +        if (!worker->s->is_address_reusable || worker->s->disablereuse) {
>>             /*
>>              * Only do a lookup if we should not reuse the backend address.
>>              * Otherwise we will look it up once for the worker.
>> @@ -2269,29 +2279,18 @@ ap_proxy_determine_connection(apr_pool_t *p, reque
>>                                         conn->hostname, APR_UNSPEC,
>>                                         conn->port, 0,
>>                                         conn->pool);
>> +            /* Ask to close the socket below */
>> +            conn->close = 1;
>>         }
>> -    }
>> -    else {
>>         /*
>> -         * In UDS cases, some structs are NULL. Protect from de-refs
>> -         * and provide info for logging at the same time.
>> -         */
>> -        apr_sockaddr_t *sa;
>> -        apr_sockaddr_info_get(&sa, NULL, APR_UNSPEC, 0, 0, conn->pool);
>> -        conn->hostname = "httpd-UDS";
>> -        conn->addr = sa;
>> -    }
>> -    if (!(uds_path) && worker->s->is_address_reusable && !worker->s->disablereuse) {
>> -        /*
>>          * Looking up the backend address for the worker only makes sense if
>>          * we can reuse the address.
>>          */
>> -        if (!worker->cp->addr) {
>> +        else if (!worker->cp->addr) {
>>             if ((err = PROXY_THREAD_LOCK(worker)) != APR_SUCCESS) {
>>                 ap_log_rerror(APLOG_MARK, APLOG_ERR, err, r, APLOGNO(00945) "lock");
>>                 return HTTP_INTERNAL_SERVER_ERROR;
>>             }
>> -
>>             /*
>>              * Worker can have the single constant backend adress.
>>              * The single DNS lookup is used once per worker.
>> [EOS]
>> <httpd-trunk-mod_proxy_determine_connection.patch>
> 


Re: ap_proxy_determine_connection() made simpler?

Posted by Jim Jagielski <ji...@jaguNET.com>.
Let me take a look... if all it doesn't is streamline the
logic then it makes sense: +1

On Jan 23, 2014, at 6:35 PM, Yann Ylavic <yl...@gmail.com> wrote:

> Hi,
> 
> I'm currently working on a patch to be able to configure the lifetime (TTL) of mod_proxy's DNS lookups (I know about graceful restarts, but that's not always an option).
> 
> I'll propose it when it'll work (al least for me), should it be of any interest.
> 
> The modified code is mainly in ap_proxy_determine_connection (that's why I may look picky about your UDS' modifications there Jim ;)
> 
> No offense, ap_proxy_determine_connection() is quite hard to follow regarding the init/reuse of connection's hostname/uds_path/address (when [and where] to do [single] DNS lookups) depending on worker's params and/or forward/reverse/UDS...
> My point is not (at all) to blame anyone (of course, keep the good work!), I guess the reason is that it has been adapted progressively with new features/fixes, as always.
> 
> I propose the following/attached patch, which rearranges the code in this way :
> 
> - UDS branch first where all relative (specific) inits/reuses are done, or else
> 
> - hostname+port init/reuse (respectively if NULL or not, since they are always cleared on cleanup if not reusable), and then
> - address (single)lookup/reuse depending solely on worker's params (is_address_reusable/disablereuse).
> 
> All the (possible) paths look identical to the previous ones, but these different actions are not mixed together as before, hence IMHO the code is clearer (and better fits my needs, although it's not necessarily your concern).
> 
> Maybe I should propose this when my patch is fully booked (and so is UDS), but since the code there is still hot, it looks like a good reason to refactor it a bit.
> I just take my chance...
> 
> Regards,
> Yann.
> 
> Index: modules/proxy/proxy_util.c
> ===================================================================
> --- modules/proxy/proxy_util.c    (revision 1560806)
> +++ modules/proxy/proxy_util.c    (working copy)
> @@ -2218,11 +2218,23 @@ ap_proxy_determine_connection(apr_pool_t *p, reque
>                           uri->scheme, uds_path);
>  
>          }
> +        /*
> +         * In UDS cases, some structs are NULL. Protect from de-refs
> +         * and provide info for logging at the same time.
> +         */
> +        if (!conn->addr) {
> +            apr_sockaddr_t *sa;
> +            apr_sockaddr_info_get(&sa, NULL, APR_UNSPEC, 0, 0, conn->pool);
> +            conn->addr = sa;
> +        }
> +        conn->hostname = "httpd-UDS";
> +        conn->port = 0;
>      }
> -    if (!(uds_path) &&
> -        (!conn->hostname || !worker->s->is_address_reusable ||
> -        worker->s->disablereuse)) {
> -        if (proxyname) {
> +    else {
> +        if (conn->hostname) {
> +            /* reuse hostname and port */
> +        }
> +        else if (proxyname) {
>              conn->hostname = apr_pstrdup(conn->pool, proxyname);
>              conn->port = proxyport;
>              /*
> @@ -2258,9 +2270,7 @@ ap_proxy_determine_connection(apr_pool_t *p, reque
>              conn->hostname = apr_pstrdup(conn->pool, uri->hostname);
>              conn->port = uri->port;
>          }
> -        socket_cleanup(conn);
> -        if (!(*worker->s->uds_path) &&
> -            (!worker->s->is_address_reusable || worker->s->disablereuse)) {
> +        if (!worker->s->is_address_reusable || worker->s->disablereuse) {
>              /*
>               * Only do a lookup if we should not reuse the backend address.
>               * Otherwise we will look it up once for the worker.
> @@ -2269,29 +2279,18 @@ ap_proxy_determine_connection(apr_pool_t *p, reque
>                                          conn->hostname, APR_UNSPEC,
>                                          conn->port, 0,
>                                          conn->pool);
> +            /* Ask to close the socket below */
> +            conn->close = 1;
>          }
> -    }
> -    else {
>          /*
> -         * In UDS cases, some structs are NULL. Protect from de-refs
> -         * and provide info for logging at the same time.
> -         */
> -        apr_sockaddr_t *sa;
> -        apr_sockaddr_info_get(&sa, NULL, APR_UNSPEC, 0, 0, conn->pool);
> -        conn->hostname = "httpd-UDS";
> -        conn->addr = sa;
> -    }
> -    if (!(uds_path) && worker->s->is_address_reusable && !worker->s->disablereuse) {
> -        /*
>           * Looking up the backend address for the worker only makes sense if
>           * we can reuse the address.
>           */
> -        if (!worker->cp->addr) {
> +        else if (!worker->cp->addr) {
>              if ((err = PROXY_THREAD_LOCK(worker)) != APR_SUCCESS) {
>                  ap_log_rerror(APLOG_MARK, APLOG_ERR, err, r, APLOGNO(00945) "lock");
>                  return HTTP_INTERNAL_SERVER_ERROR;
>              }
> -
>              /*
>               * Worker can have the single constant backend adress.
>               * The single DNS lookup is used once per worker.
> [EOS]
> <httpd-trunk-mod_proxy_determine_connection.patch>