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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]