tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r749498 - /tomcat/connectors/trunk/jk/native/common/jk_status.c
Date Tue, 03 Mar 2009 00:42:16 GMT
Author: rjung
Date: Tue Mar  3 00:42:16 2009
New Revision: 749498

URL: http://svn.apache.org/viewvc?rev=749498&view=rev
Log:
Provide an error message in status worker, in case
a new worker address could not be resolved.
Use error messages coming from commit_member() in
update_worker() and augment them in the wildcard case.

Modified:
    tomcat/connectors/trunk/jk/native/common/jk_status.c

Modified: tomcat/connectors/trunk/jk/native/common/jk_status.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_status.c?rev=749498&r1=749497&r2=749498&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_status.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_status.c Tue Mar  3 00:42:16 2009
@@ -3219,8 +3219,12 @@
         aw->port = aw->s->port;
         if (!jk_resolve(host, port, &inet_addr,
                         aw->worker.we->pool, l)) {
+            const char *msg = "Update failed (at least partially): could not resolve address
'%s:%d' for sub worker '%s'.";
+            size_t size = strlen(msg) + strlen(host) + strlen(aw->name) + 10 + 1;
+            p->msg = jk_pool_alloc(s->pool, size);
+            snprintf(p->msg, size, msg, host, port, aw->name);
             jk_log(l, JK_LOG_ERROR,
-                   "Status worker '%s' failed resolving 'address' for sub worker '%s' to
'%s:%d'",
+                   "Status worker '%s' failed resolving 'address' for sub worker '%s' to
'%s:%d'.",
                    w->name, aw->name, host, port);
             rc = JK_FALSE;
         }
@@ -4012,7 +4016,25 @@
                 if (rv & JK_STATUS_NEEDS_UPDATE_MULT)
                     /* Recalculate the load multiplicators wrt. lb_factor */
                     update_mult(lb, l);
-                if (!wi || (rc == JK_FALSE))
+                if (rc == JK_FALSE) {
+                    jk_log(l, JK_LOG_ERROR,
+                           "Status worker '%s' failed updating sub worker '%s' (at least
partially).%s",
+                           w->name, aw->name, (is_wildchar == JK_TRUE) ? " Aborting
further wildcard updates." : "");
+                    if (!strncmp("OK", p->msg, 3)) {
+                        const char *msg = "Update failed (at least partially) for sub worker
'%s'";
+                        size_t size = strlen(msg) + strlen(aw->name) + 1;
+                        p->msg = jk_pool_alloc(s->pool, size);
+                        snprintf(p->msg, size, msg, aw->name);
+                    }
+                    if (is_wildchar == JK_TRUE) {
+                        const char *msg = " Aborting further wildcard updates.";
+                        size_t size = strlen(msg) + strlen(p->msg) + 1;
+                        p->msg = jk_pool_realloc(s->pool, size, p->msg, strlen(p->msg)
+ 1);
+                        strcat(p->msg, msg);
+                    }
+                    break;
+                }
+                if (!wi)
                     break;
             }
             JK_TRACE_EXIT(l);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message