This patch documents and alters the pconn idle timeout directives.

RFC, because this alters the directive names. Alternative naming welcome up to the point of commit.

It also alters the well known messages in mgr:filedescriptors report a little to indicate client/server type and adds a standard "Idle " prefix for easy grep.

Amos
Clarify the persistent connection timeouts

* Rename the persistent connection idle timeout directives
  This makes them a lot clearer which of the pconn sets they control.

* updated the text on the client timeout to say client explicitly

* updated FD table notes to mark client vs server clearly

=== modified file 'src/cf.data.pre'
--- src/cf.data.pre     2011-11-06 22:52:18 +0000
+++ src/cf.data.pre     2011-11-07 05:46:44 +0000
@@ -4658,13 +4658,17 @@
        connection establishment.
 DOC_END
 
-NAME: persistent_request_timeout
+NAME: client_idle_pconn_timeout persistent_request_timeout
 TYPE: time_t
-LOC: Config.Timeout.persistent_request
+LOC: Config.Timeout.clientIdlePconn
 DEFAULT: 2 minutes
 DOC_START
        How long to wait for the next HTTP request on a persistent
-       connection after the previous request completes.
+       client connection after the previous request completes.
+       
+       This is only relevant when persistent client connections
+       are enabled. Non-persistent connections will close
+       immediately after each request is completed.
 DOC_END
 
 NAME: client_lifetime
@@ -4708,9 +4712,9 @@
        it is recommended to leave OFF.
 DOC_END
 
-NAME: pconn_timeout
+NAME: server_idle_pconn_timeout
 TYPE: time_t
-LOC: Config.Timeout.pconn
+LOC: Config.Timeout.serverIdlePconn
 DEFAULT: 1 minute
 DOC_START
        Timeout for idle persistent connections to servers and other

=== modified file 'src/client_side.cc'
--- src/client_side.cc  2011-10-27 15:27:25 +0000
+++ src/client_side.cc  2011-11-07 05:54:29 +0000
@@ -1485,14 +1485,14 @@
 {
     debugs(33, 5, HERE << clientConnection << " reading next req");
 
-    fd_note(clientConnection->fd, "Waiting for next request");
+    fd_note(clientConnection->fd, "Idle client: Waiting for next request");
     /**
      * Set the timeout BEFORE calling clientReadRequest().
      */
     typedef CommCbMemFunT<ConnStateData, CommTimeoutCbParams> TimeoutDialer;
     AsyncCall::Pointer timeoutCall = JobCallback(33, 5,
                                      TimeoutDialer, this, 
ConnStateData::requestTimeout);
-    commSetConnTimeout(clientConnection, Config.Timeout.persistent_request, 
timeoutCall);
+    commSetConnTimeout(clientConnection, Config.Timeout.clientIdlePconn, 
timeoutCall);
 
     readSomeData();
     /** Please don't do anything with the FD past here! */

=== modified file 'src/pconn.cc'
--- src/pconn.cc        2011-09-06 08:24:09 +0000
+++ src/pconn.cc        2011-11-07 05:53:59 +0000
@@ -192,7 +192,7 @@
     comm_read(conn, fakeReadBuf_, sizeof(fakeReadBuf_), readCall);
     AsyncCall::Pointer timeoutCall = commCbCall(5,4, "IdleConnList::Timeout",
                                      
CommTimeoutCbPtrFun(IdleConnList::Timeout, this));
-    commSetConnTimeout(conn, Config.Timeout.pconn, timeoutCall);
+    commSetConnTimeout(conn, Config.Timeout.serverIdlePconn, timeoutCall);
 }
 
 /// Determine whether an entry in the idle list is available for use.
@@ -417,7 +417,7 @@
     assert(!comm_has_incomplete_write(conn->fd));
 
     LOCAL_ARRAY(char, desc, FD_DESC_SZ);
-    snprintf(desc, FD_DESC_SZ, "Idle: %s", aKey);
+    snprintf(desc, FD_DESC_SZ, "Idle server: %s", aKey);
     fd_note(conn->fd, desc);
     debugs(48, 3, HERE << "pushed " << conn << " for " << aKey);
 }

Reply via email to