Author: jfrederic.clere(a)jboss.com
Date: 2009-01-15 12:00:47 -0500 (Thu, 15 Jan 2009)
New Revision: 2169
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Arrange timeout handling for sessionid and check return codes.
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2009-01-15 10:39:14 UTC
(rev 2168)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2009-01-15 17:00:47 UTC
(rev 2169)
@@ -70,7 +70,7 @@
#define WAITFORREMOVE 10 /* seconds */
#define TIMEINTERVAL apr_time_from_sec(1) /* recalcul the lbstatus based on number of
request in the time interval */
-#define TIMESESSIONID apr_time_from_sec(300) /* after 5 minutes the sessionid have
probably timeout */
+#define TIMESESSIONID 300 /* after 5 minutes the sessionid have
probably timeout */
/* reslist constructor */
/* XXX: Should use the proxy_util one. */
@@ -612,7 +612,8 @@
/* update lbstatus if needed */
for (i=0; i<size; i++) {
nodeinfo_t *ou;
- node_storage->read_node(id[i], &ou);
+ if (node_storage->read_node(id[i], &ou) != APR_SUCCESS)
+ continue;
if (ou->mess.updatetimelb < (now - TIMEINTERVAL)) {
/* The lbstatus needs to be updated */
int elected, oldelected;
@@ -639,7 +640,7 @@
apr_time_t now;
int notok = 0;
- now = apr_time_now();
+ now = apr_time_sec(apr_time_now());
/* read the ident of the sessionid */
id = apr_pcalloc(pool, sizeof(int) *
sessionid_storage->get_max_size_sessionid());
@@ -648,7 +649,8 @@
/* update lbstatus if needed */
for (i=0; i<size; i++) {
sessionidinfo_t *ou;
- sessionid_storage->read_sessionid(id[i], &ou);
+ if (sessionid_storage->read_sessionid(id[i], &ou) != APR_SUCCESS)
+ continue;
if (ou->updatetime < (now - TIMESESSIONID)) {
/* Remove it */
sessionid_storage->remove_sessionid(ou);
Show replies by date