Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 3513 invoked from network); 4 Jun 2006 09:12:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Jun 2006 09:12:43 -0000 Received: (qmail 19726 invoked by uid 500); 4 Jun 2006 09:12:40 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 19663 invoked by uid 500); 4 Jun 2006 09:12:40 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 19652 invoked by uid 500); 4 Jun 2006 09:12:39 -0000 Delivered-To: apmail-jakarta-tomcat-dev@jakarta.apache.org Received: (qmail 19649 invoked by uid 99); 4 Jun 2006 09:12:39 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Jun 2006 02:12:39 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Jun 2006 02:12:39 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id DA2FF1A983A; Sun, 4 Jun 2006 02:12:18 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r411541 - in /tomcat/connectors/trunk/jk/native/common: jk_ajp_common.c jk_ajp_common.h jk_util.c Date: Sun, 04 Jun 2006 09:12:18 -0000 To: tomcat-dev@jakarta.apache.org From: mturk@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060604091218.DA2FF1A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: mturk Date: Sun Jun 4 02:12:17 2006 New Revision: 411541 URL: http://svn.apache.org/viewvc?rev=411541&view=rev Log: Deprecate recycle_timeout. It purpose was the same as cache_timeout. Also, to be consistent log every cache related thing as connection pool. Modified: tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c tomcat/connectors/trunk/jk/native/common/jk_ajp_common.h tomcat/connectors/trunk/jk/native/common/jk_util.c Modified: tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c?rev=411541&r1=411540&r2=411541&view=diff ============================================================================== --- tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c (original) +++ tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c Sun Jun 4 02:12:17 2006 @@ -866,7 +866,7 @@ jk_dump_hinfo(&ae->worker->worker_inet_addr, buf)); } /* set last_access only if needed */ - if (ae->worker->cache_timeout > 0 || ae->worker->recycle_timeout > 0) + if (ae->worker->cache_timeout > 0) ae->last_access = time(NULL); /* Check if we must execute a logon after the physical connect */ if (ae->worker->logon != NULL) { @@ -1856,13 +1856,13 @@ } if (JK_IS_DEBUG_LEVEL(l)) jk_log(l, JK_LOG_DEBUG, - "setting connection cache size to %u with min %u", + "setting connection pool size to %u with min %u", p->ep_cache_sz, p->ep_mincache_sz); for (i = 0; i < p->ep_cache_sz; i++) { p->ep_cache[i] = (ajp_endpoint_t *)calloc(1, sizeof(ajp_endpoint_t)); if (!p->ep_cache[i]) { jk_log(l, JK_LOG_ERROR, - "creating endpont cache slot %d errno=%d", + "creating endpont pool slot %d errno=%d", i, errno); JK_TRACE_EXIT(l); return JK_FALSE; @@ -1913,9 +1913,6 @@ "setting socket keepalive to %d", p->keepalive); - p->recycle_timeout = - jk_get_worker_recycle_timeout(props, p->name, AJP13_DEF_TIMEOUT); - p->cache_timeout = jk_get_worker_cache_timeout(props, p->name, AJP_DEF_CACHE_TIMEOUT); @@ -1957,11 +1954,7 @@ p->socket_buf); jk_log(l, JK_LOG_DEBUG, - "setting connection recycle timeout to %d", - p->recycle_timeout); - - jk_log(l, JK_LOG_DEBUG, - "setting cache timeout to %d", + "setting connection pool timeout to %d", p->cache_timeout); jk_log(l, JK_LOG_DEBUG, @@ -2001,7 +1994,7 @@ } if (!ajp_create_endpoint_cache(p, proto, l)) { jk_log(l, JK_LOG_ERROR, - "allocating ep_cache of size %u", + "allocating connection pool of size %u", p->ep_cache_sz); JK_TRACE_EXIT(l); return JK_FALSE; @@ -2080,7 +2073,7 @@ ajp_reset_endpoint(p, l); *e = NULL; /* set last_access only if needed */ - if (w->cache_timeout > 0 || w->recycle_timeout > 0) + if (w->cache_timeout > 0) p->last_access = time(NULL); JK_LEAVE_CS(&w->cs, rc); if (sock >= 0) @@ -2088,7 +2081,7 @@ if (i >= 0) { if (JK_IS_DEBUG_LEVEL(l)) jk_log(l, JK_LOG_DEBUG, - "recycling connection cache slot=%u for worker %s", + "recycling connection pool slot=%u for worker %s", i, p->worker->name); JK_TRACE_EXIT(l); return JK_TRUE; @@ -2097,7 +2090,7 @@ * there is always free empty cache slot */ jk_log(l, JK_LOG_ERROR, - "could not find empty cache slot from %u for worker %s", + "could not find empty connection pool slot from %u for worker %s", w->ep_cache_sz, w->name); JK_TRACE_EXIT(l); return JK_FALSE; @@ -2125,7 +2118,7 @@ time_t now = 0; int rc; /* Obtain current time only if needed */ - if (aw->cache_timeout > 0 || aw->recycle_timeout > 0) + if (aw->cache_timeout > 0) now = time(NULL); *je = NULL; @@ -2145,7 +2138,7 @@ JK_LEAVE_CS(&aw->cs, rc); if (JK_IS_DEBUG_LEVEL(l)) jk_log(l, JK_LOG_DEBUG, - "acquired connection cache slot=%u", + "acquired connection pool slot=%u", slot); JK_TRACE_EXIT(l); return JK_TRUE; @@ -2185,7 +2178,7 @@ time_t now; int rc; /* Obtain current time only if needed */ - if (aw->cache_timeout > 0 || aw->recycle_timeout > 0) + if (aw->cache_timeout > 0) now = time(NULL); else { /* Nothing to do. */ @@ -2200,8 +2193,7 @@ /* Skip the closed sockets */ if (aw->ep_cache[i] && aw->ep_cache[i]->sd >= 0) { int elapsed = (int)difftime(now, aw->ep_cache[i]->last_access); - if (((aw->cache_timeout > 0) && (elapsed > aw->cache_timeout)) || - ((aw->recycle_timeout > 0) && (elapsed > aw->recycle_timeout))) { + if ((aw->cache_timeout > 0) && (elapsed > aw->cache_timeout)) { time_t rt = 0; n++; if (JK_IS_DEBUG_LEVEL(l)) @@ -2210,14 +2202,14 @@ ajp_reset_endpoint(aw->ep_cache[i], l); if (JK_IS_DEBUG_LEVEL(l)) jk_log(l, JK_LOG_DEBUG, - "cleaning cache slot=%u elapsed %d in %d", + "cleaning pool slot=%u elapsed %d in %d", i, elapsed, (int)(difftime(time(NULL), rt))); } } if (n > aw->ep_mincache_sz) { if (JK_IS_DEBUG_LEVEL(l)) { jk_log(l, JK_LOG_DEBUG, - "reached cache min size %u from %u cache slots", + "reached pool min size %u from %u cache slots", aw->ep_mincache_sz, aw->ep_cache_sz); } break; @@ -2225,7 +2217,7 @@ } if (JK_IS_DEBUG_LEVEL(l)) jk_log(l, JK_LOG_DEBUG, - "recycled %u sockets in %d seconds from %u cache slots", + "recycled %u sockets in %d seconds from %u pool slots", n, (int)(difftime(time(NULL), now)), aw->ep_cache_sz); JK_LEAVE_CS(&aw->cs, rc); Modified: tomcat/connectors/trunk/jk/native/common/jk_ajp_common.h URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_ajp_common.h?rev=411541&r1=411540&r2=411541&view=diff ============================================================================== --- tomcat/connectors/trunk/jk/native/common/jk_ajp_common.h (original) +++ tomcat/connectors/trunk/jk/native/common/jk_ajp_common.h Sun Jun 4 02:12:17 2006 @@ -261,8 +261,6 @@ */ int (*logon) (ajp_endpoint_t * ae, jk_logger_t *l); - /* Reclycle inactive connections */ - int recycle_timeout; /* * Handle Socket Timeouts */ Modified: tomcat/connectors/trunk/jk/native/common/jk_util.c URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_util.c?rev=411541&r1=411540&r2=411541&view=diff ============================================================================== --- tomcat/connectors/trunk/jk/native/common/jk_util.c (original) +++ tomcat/connectors/trunk/jk/native/common/jk_util.c Sun Jun 4 02:12:17 2006 @@ -48,8 +48,9 @@ #define TYPE_OF_WORKER ("type") #define CACHE_OF_WORKER_DEPRECATED ("cachesize") #define CACHE_OF_WORKER ("connection_pool_size") -#define CACHE_OF_WORKER_MIN ("connection_min_pool_size") -#define CACHE_TIMEOUT_OF_WORKER ("cache_timeout") +#define CACHE_OF_WORKER_MIN ("connection_pool_minsize") +#define CACHE_TIMEOUT_DEPRECATED ("cache_timeout") +#define CACHE_TIMEOUT_OF_WORKER ("connection_pool_timeout") #define RECOVERY_OPTS_OF_WORKER ("recovery_options") #define CONNECT_TIMEOUT_OF_WORKER ("connect_timeout") #define PREPOST_TIMEOUT_OF_WORKER ("prepost_timeout") @@ -57,7 +58,7 @@ #define SOCKET_TIMEOUT_OF_WORKER ("socket_timeout") #define SOCKET_BUFFER_OF_WORKER ("socket_buffer") #define SOCKET_KEEPALIVE_OF_WORKER ("socket_keepalive") -#define RECYCLE_TIMEOUT_OF_WORKER ("recycle_timeout") +#define RECYCLE_TIMEOUT_DEPRECATED ("recycle_timeout") #define LOAD_FACTOR_OF_WORKER ("lbfactor") #define DISTANCE_OF_WORKER ("distance") /* deprecated directive. Use balance_workers instead */ @@ -596,12 +597,16 @@ int jk_get_worker_cache_timeout(jk_map_t *m, const char *wname, int def) { char buf[1024]; + int rv; if (!m || !wname) { return -1; } MAKE_WORKER_PARAM(CACHE_TIMEOUT_OF_WORKER); + if ((rv = jk_map_get_int(m, buf, -1)) >= 0) + return rv; + MAKE_WORKER_PARAM(CACHE_TIMEOUT_DEPRECATED); return jk_map_get_int(m, buf, def); } @@ -647,15 +652,7 @@ int jk_get_worker_recycle_timeout(jk_map_t *m, const char *wname, int def) { - char buf[1024]; - - if (!m || !wname) { - return -1; - } - - MAKE_WORKER_PARAM(RECYCLE_TIMEOUT_OF_WORKER); - - return jk_map_get_int(m, buf, def); + return def; } int jk_get_worker_retries(jk_map_t *m, const char *wname, int def) @@ -1085,6 +1082,7 @@ CACHE_OF_WORKER, CACHE_OF_WORKER_MIN, CACHE_TIMEOUT_OF_WORKER, + CACHE_TIMEOUT_DEPRECATED, RECOVERY_OPTS_OF_WORKER, CONNECT_TIMEOUT_OF_WORKER, PREPOST_TIMEOUT_OF_WORKER, @@ -1092,7 +1090,7 @@ SOCKET_TIMEOUT_OF_WORKER, SOCKET_BUFFER_OF_WORKER, SOCKET_KEEPALIVE_OF_WORKER, - RECYCLE_TIMEOUT_OF_WORKER, + RECYCLE_TIMEOUT_DEPRECATED, LOAD_FACTOR_OF_WORKER, STICKY_SESSION, STICKY_SESSION_FORCE, @@ -1111,6 +1109,8 @@ static const char *deprecated_properties[] = { CACHE_OF_WORKER_DEPRECATED, + CACHE_TIMEOUT_DEPRECATED, + RECYCLE_TIMEOUT_DEPRECATED, MX_OF_WORKER, MS_OF_WORKER, CP_OF_WORKER, --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org