You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2008/09/17 16:23:39 UTC

svn commit: r696316 - in /httpd/httpd/branches/2.2.x: CHANGES docs/manual/mod/mod_proxy.xml include/ap_mmn.h modules/proxy/mod_proxy.c modules/proxy/mod_proxy.h modules/proxy/proxy_util.c

Author: jim
Date: Wed Sep 17 07:23:35 2008
New Revision: 696316

URL: http://svn.apache.org/viewvc?rev=696316&view=rev
Log:
 * mod_proxy: Add the possibility to set a separate connection timeout for
    backend workers.
       PR: 45445
           Trunk version of patch:
                  http://svn.apache.org/viewvc?rev=684341&view=rev
                      Backport version for 2.2.x of patch:
                             Trunk version of patch works, but 
                                    http://people.apache.org/~rpluem/patches/37770_2.2.x.diff
                                           fixes a conflict regarding the needed minor bump.
                                               +1: rpluem, jim, jerenkrantz


Modified:
    httpd/httpd/branches/2.2.x/CHANGES
    httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml
    httpd/httpd/branches/2.2.x/include/ap_mmn.h
    httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c
    httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.h
    httpd/httpd/branches/2.2.x/modules/proxy/proxy_util.c

Modified: httpd/httpd/branches/2.2.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?rev=696316&r1=696315&r2=696316&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Wed Sep 17 07:23:35 2008
@@ -18,6 +18,10 @@
   *) mod_ssl: Rewrite shmcb to avoid memory alignment issues.  PR 42101.
      [Geoff Thorpe]
 
+  *) mod_proxy_http: Introduce environment variable proxy-initial-not-pooled to
+     avoid reusing pooled connections if the client connection is an initial
+     connection. PR 37770. [Ruediger Pluem]
+
   *) mod_dav_fs: Retrieve minimal system information about directory
      entries when walking a DAV fs, resolving a performance degradation on
      Windows.  PR 45464.  [Joe Orton, Jeff Trawick]

Modified: httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml?rev=696316&r1=696315&r2=696316&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml (original)
+++ httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml Wed Sep 17 07:23:35 2008
@@ -689,6 +689,12 @@
     connections in the pool the Apache will return <code>SERVER_BUSY</code>
     status to the client.
     </td></tr>
+    <tr><td>connectiontimeout</td>
+        <td>timeout</td>
+        <td>Connect timeout in seconds.
+        The number of seconds Apache waits for the creation of a connection to
+        the backend to complete.
+    </td></tr>
     <tr><td>disablereuse</td>
         <td>Off</td>
         <td>This parameter should be used when you want to force mod_proxy

Modified: httpd/httpd/branches/2.2.x/include/ap_mmn.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/include/ap_mmn.h?rev=696316&r1=696315&r2=696316&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/include/ap_mmn.h (original)
+++ httpd/httpd/branches/2.2.x/include/ap_mmn.h Wed Sep 17 07:23:35 2008
@@ -128,6 +128,8 @@
  *                     structure
  * 20051115.15(2.2.9)  Add interpolate_env to proxy_dir_conf and
  *                     introduce proxy_req_conf.
+ * 20051115.16(2.2.9)  Add conn_timeout and conn_timeout_set to
+ *                     proxy_worker struct.
  *
  */
 
@@ -136,7 +138,7 @@
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
 #define MODULE_MAGIC_NUMBER_MAJOR 20051115
 #endif
-#define MODULE_MAGIC_NUMBER_MINOR 15                    /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 16                    /* 0...n */
 
 /**
  * Determine if the server's current MODULE_MAGIC_NUMBER is at least a

Modified: httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c?rev=696316&r1=696315&r2=696316&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c (original)
+++ httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c Wed Sep 17 07:23:35 2008
@@ -275,6 +275,16 @@
         worker->ping_timeout = apr_time_from_sec(ival);
         worker->ping_timeout_set = 1;
     }
+    else if (!strcasecmp(key, "connectiontimeout")) {
+        /* Request timeout in seconds.
+         * Defaults to connection timeout
+         */
+        ival = atoi(val);
+        if (ival < 1)
+            return "Connectiontimeout must be at least one second.";
+        worker->conn_timeout = apr_time_from_sec(ival);
+        worker->conn_timeout_set = 1;
+    }
     else {
         return "unknown Worker parameter";
     }

Modified: httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.h?rev=696316&r1=696315&r2=696316&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.h (original)
+++ httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.h Wed Sep 17 07:23:35 2008
@@ -355,6 +355,8 @@
     char            retry_set;
     char            disablereuse;
     char            disablereuse_set;
+    apr_interval_time_t conn_timeout;
+    char            conn_timeout_set;
 };
 
 /*

Modified: httpd/httpd/branches/2.2.x/modules/proxy/proxy_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/proxy/proxy_util.c?rev=696316&r1=696315&r2=696316&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/branches/2.2.x/modules/proxy/proxy_util.c Wed Sep 17 07:23:35 2008
@@ -2329,8 +2329,11 @@
                           "Failed to set");
         }
 
-        /* Set a timeout on the socket */
-        if (worker->timeout_set == 1) {
+        /* Set a timeout for connecting to the backend on the socket */
+        if (worker->conn_timeout_set) {
+            apr_socket_timeout_set(newsock, worker->conn_timeout);
+        }
+        else if (worker->timeout_set == 1) {
             apr_socket_timeout_set(newsock, worker->timeout);
         }
         else if (conf->timeout_set == 1) {
@@ -2368,6 +2371,17 @@
             continue;
         }
 
+        /* Set a timeout on the socket */
+        if (worker->timeout_set == 1) {
+            apr_socket_timeout_set(newsock, worker->timeout);
+        }
+        else if (conf->timeout_set == 1) {
+            apr_socket_timeout_set(newsock, conf->timeout);
+        }
+        else {
+             apr_socket_timeout_set(newsock, s->timeout);
+        }
+
         conn->sock   = newsock;
         connected    = 1;
     }



Re: svn commit: r696316 - in /httpd/httpd/branches/2.2.x: CHANGES docs/manual/mod/mod_proxy.xml include/ap_mmn.h modules/proxy/mod_proxy.c modules/proxy/mod_proxy.h modules/proxy/proxy_util.c

Posted by Eric Covener <co...@gmail.com>.
On Wed, Sep 17, 2008 at 12:45 PM, Eric Covener <co...@gmail.com> wrote:
> I believe this is now correct w/ r696366 if you want to doublecheck.

Jim, I think you re-broke it with your last two CHANGES updates.  You
left it with  two "PR 45445" and no "initial-not-pooled" (and latter
is committed)

-- 
Eric Covener
covener@gmail.com

Re: svn commit: r696316 - in /httpd/httpd/branches/2.2.x: CHANGES docs/manual/mod/mod_proxy.xml include/ap_mmn.h modules/proxy/mod_proxy.c modules/proxy/mod_proxy.h modules/proxy/proxy_util.c

Posted by Eric Covener <co...@gmail.com>.
On Wed, Sep 17, 2008 at 12:41 PM, Eric Covener <co...@gmail.com> wrote:
> On Wed, Sep 17, 2008 at 10:23 AM,  <ji...@apache.org> wrote:
>> Author: jim
>> Date: Wed Sep 17 07:23:35 2008
>> New Revision: 696316
>>
>> URL: http://svn.apache.org/viewvc?rev=696316&view=rev
>> Log:
>>  * mod_proxy: Add the possibility to set a separate connection timeout for
>>    backend workers.
>>       PR: 45445
>>           Trunk version of patch:
>>                  http://svn.apache.org/viewvc?rev=684341&view=rev
>>                      Backport version for 2.2.x of patch:
>>                             Trunk version of patch works, but
>>                                    http://people.apache.org/~rpluem/patches/37770_2.2.x.diff
>>                                           fixes a conflict regarding the needed minor bump.
>>                                               +1: rpluem, jim, jerenkrantz
>>
>>
>> Modified:
>>    httpd/httpd/branches/2.2.x/CHANGES
>>
>> +  *) mod_proxy_http: Introduce environment variable proxy-initial-not-pooled to
>> +     avoid reusing pooled connections if the client connection is an initial
>> +     connection. PR 37770. [Ruediger Pluem]
>> +
>
>
> ended up with wrong CHANGES entry?

I believe this is now correct w/ r696366 if you want to doublecheck.

-- 
Eric Covener
covener@gmail.com

Re: svn commit: r696316 - in /httpd/httpd/branches/2.2.x: CHANGES docs/manual/mod/mod_proxy.xml include/ap_mmn.h modules/proxy/mod_proxy.c modules/proxy/mod_proxy.h modules/proxy/proxy_util.c

Posted by Eric Covener <co...@gmail.com>.
On Wed, Sep 17, 2008 at 10:23 AM,  <ji...@apache.org> wrote:
> Author: jim
> Date: Wed Sep 17 07:23:35 2008
> New Revision: 696316
>
> URL: http://svn.apache.org/viewvc?rev=696316&view=rev
> Log:
>  * mod_proxy: Add the possibility to set a separate connection timeout for
>    backend workers.
>       PR: 45445
>           Trunk version of patch:
>                  http://svn.apache.org/viewvc?rev=684341&view=rev
>                      Backport version for 2.2.x of patch:
>                             Trunk version of patch works, but
>                                    http://people.apache.org/~rpluem/patches/37770_2.2.x.diff
>                                           fixes a conflict regarding the needed minor bump.
>                                               +1: rpluem, jim, jerenkrantz
>
>
> Modified:
>    httpd/httpd/branches/2.2.x/CHANGES
>
> +  *) mod_proxy_http: Introduce environment variable proxy-initial-not-pooled to
> +     avoid reusing pooled connections if the client connection is an initial
> +     connection. PR 37770. [Ruediger Pluem]
> +


ended up with wrong CHANGES entry?

-- 
Eric Covener
covener@gmail.com