Author: jfrederic.clere(a)jboss.com
Date: 2009-01-15 12:21:49 -0500 (Thu, 15 Jan 2009)
New Revision: 2171
Modified:
trunk/mod_cluster/native/mod_manager/mod_manager.c
Log:
Skip element when read fails.
Modified: trunk/mod_cluster/native/mod_manager/mod_manager.c
===================================================================
--- trunk/mod_cluster/native/mod_manager/mod_manager.c 2009-01-15 17:04:27 UTC (rev 2170)
+++ trunk/mod_cluster/native/mod_manager/mod_manager.c 2009-01-15 17:21:49 UTC (rev 2171)
@@ -172,7 +172,8 @@
size = get_ids_used_node(nodestatsmem, id);
for (i=0; i<size; i++) {
nodeinfo_t *ou;
- get_node(nodestatsmem, &ou, id[i]);
+ if (get_node(nodestatsmem, &ou, id[i]) != APR_SUCCESS)
+ continue;
if (ou->updatetime > last)
last = ou->updatetime;
}
@@ -792,7 +793,8 @@
size = get_ids_used_balancer(balancerstatsmem, id);
for (i=0; i<size; i++) {
balancerinfo_t *ou;
- get_balancer(balancerstatsmem, &ou, id[i]);
+ if (get_balancer(balancerstatsmem, &ou, id[i]) != APR_SUCCESS)
+ continue;
ap_rprintf(r, "balancer: [%d] Name: %s Sticky: %d [%s]/[%s] remove: %d
force: %d Timeout: %d Maxtry: %d\n",
id[i], ou->balancer, ou->StickySession,
ou->StickySessionCookie, ou->StickySessionPath,
@@ -805,7 +807,8 @@
size = get_ids_used_node(nodestatsmem, id);
for (i=0; i<size; i++) {
nodeinfo_t *ou;
- get_node(nodestatsmem, &ou, id[i]);
+ if (get_node(nodestatsmem, &ou, id[i]) != APR_SUCCESS)
+ continue;
ap_rprintf(r, "node: [%d:%d],Balancer: %s,JVMRoute: %s,Domain: [%s],Host:
%s,Port: %s,Type: %s,flushpackets: %d,flushwait: %d,ping: %d,smax: %d,ttl: %d,timeout:
%d\n",
id[i], ou->mess.id, ou->mess.balancer, ou->mess.JVMRoute,
ou->mess.Domain,
ou->mess.Host, ou->mess.Port, ou->mess.Type,
@@ -818,7 +821,8 @@
size = get_ids_used_host(hoststatsmem, id);
for (i=0; i<size; i++) {
hostinfo_t *ou;
- get_host(hoststatsmem, &ou, id[i]);
+ if (get_host(hoststatsmem, &ou, id[i]) != APR_SUCCESS)
+ continue;
ap_rprintf(r, "host: %d [%s] vhost: %d node: %d\n", id[i], ou->host,
ou->vhost,
ou->node);
}
@@ -828,7 +832,8 @@
size = get_ids_used_context(contextstatsmem, id);
for (i=0; i<size; i++) {
contextinfo_t *ou;
- get_context(contextstatsmem, &ou, id[i]);
+ if (get_context(contextstatsmem, &ou, id[i]) != APR_SUCCESS)
+ continue;
ap_rprintf(r, "context: %d [%s] vhost: %d node: %d status: %d\n",
id[i], ou->context,
ou->vhost, ou->node,
ou->status);
@@ -853,7 +858,8 @@
nodeinfo_t *ou;
proxy_worker_stat *proxystat;
char *flushpackets;
- get_node(nodestatsmem, &ou, id[i]);
+ if (get_node(nodestatsmem, &ou, id[i]) != APR_SUCCESS)
+ continue;
ap_rprintf(r, "Node: [%d],Name: %s,Balancer: %s,Domain: %s,Host: %s,Port:
%s,Type: %s",
id[i], ou->mess.JVMRoute, ou->mess.balancer,
ou->mess.Domain,
ou->mess.Host, ou->mess.Port, ou->mess.Type);
@@ -881,7 +887,8 @@
size = get_ids_used_host(hoststatsmem, id);
for (i=0; i<size; i++) {
hostinfo_t *ou;
- get_host(hoststatsmem, &ou, id[i]);
+ if (get_host(hoststatsmem, &ou, id[i]) != APR_SUCCESS)
+ continue;
ap_rprintf(r, "Vhost: [%d:%d:%d], Alias: %s\n",
ou->node, ou->vhost, id[i], ou->host);
}
@@ -893,7 +900,8 @@
for (i=0; i<size; i++) {
contextinfo_t *ou;
char *status;
- get_context(contextstatsmem, &ou, id[i]);
+ if (get_context(contextstatsmem, &ou, id[i]) != APR_SUCCESS)
+ continue;
status = "REMOVED";
switch (ou->status) {
case ENABLED:
@@ -930,7 +938,8 @@
int sizecontext;
int *idcontext;
- get_host(hoststatsmem, &ou, id[i]);
+ if (get_host(hoststatsmem, &ou, id[i]) != APR_SUCCESS)
+ continue;
if (ou->node != node->mess.id)
continue;
/* If the host corresponds to a node process all contextes */
@@ -939,7 +948,8 @@
sizecontext = get_ids_used_context(contextstatsmem, idcontext);
for (j=0; j<sizecontext; j++) {
contextinfo_t *context;
- get_context(contextstatsmem, &context, idcontext[j]);
+ if (get_context(contextstatsmem, &context, idcontext[j]) != APR_SUCCESS)
+ continue;
if (context->vhost == ou->vhost &&
context->node == ou->node) {
/* Process the context */
@@ -1088,7 +1098,8 @@
size = get_ids_used_context(contextstatsmem, id);
for (i=0; i<size; i++) {
contextinfo_t *ou;
- get_context(contextstatsmem, &ou, id[i]);
+ if (get_context(contextstatsmem, &ou, id[i]) != APR_SUCCESS)
+ continue;
if (ou->vhost == host->vhost &&
ou->node == node->mess.id)
break;
@@ -1282,7 +1293,8 @@
for (i=0; i<size; i++) {
contextinfo_t *ou;
char *status;
- get_context(contextstatsmem, &ou, id[i]);
+ if (get_context(contextstatsmem, &ou, id[i]) != APR_SUCCESS)
+ continue;
if (ou->node != node && ou->vhost != host)
continue;
status = "REMOVED";
@@ -1313,7 +1325,8 @@
size = get_ids_used_host(hoststatsmem, id);
for (i=0; i<size; i++) {
hostinfo_t *ou;
- get_host(hoststatsmem, &ou, id[i]);
+ if (get_host(hoststatsmem, &ou, id[i]) != APR_SUCCESS)
+ continue;
if (ou->node != node)
continue;
if (ou->vhost != vhost) {
@@ -1343,7 +1356,8 @@
size = get_ids_used_sessionid(sessionidstatsmem, id);
for (i=0; i<size; i++) {
sessionidinfo_t *ou;
- get_sessionid(sessionidstatsmem, &ou, id[i]);
+ if (get_sessionid(sessionidstatsmem, &ou, id[i]) != APR_SUCCESS)
+ continue;
ap_rprintf(r, "id: %s route: %s\n", ou->sessionid,
ou->JVMRoute);
}
ap_rprintf(r, "</pre>");
@@ -1414,7 +1428,8 @@
nodeinfo_t *ou;
proxy_worker_stat *proxystat;
char *flushpackets;
- get_node(nodestatsmem, &ou, id[i]);
+ if (get_node(nodestatsmem, &ou, id[i]) != APR_SUCCESS)
+ continue;
ap_rprintf(r, "<h1> Node %s (%s://%s:%s):</h1>\n",
ou->mess.JVMRoute, ou->mess.Type, ou->mess.Host,
ou->mess.Port);