tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r749685 - in /tomcat/connectors/trunk/jk/native/common: jk_ajp_common.c jk_ajp_common.h jk_lb_worker.c jk_lb_worker.h jk_status.c
Date Tue, 03 Mar 2009 18:38:51 GMT
Author: rjung
Date: Tue Mar  3 18:38:51 2009
New Revision: 749685

URL: http://svn.apache.org/viewvc?rev=749685&view=rev
Log:
Some updates related to dynamic address change:

- Include shm lock and unlock in pull and push
  functions. Indicate whether we already acquired
  the lock with the new argument "locked".
- Move the dynamic address resolution into jk_ajp_pull().
  Do the actual resolution outside of the lock,
  and don't change the worker is the resolution fails.
  In case of failure log an error, but do not fail fatal.
- Use a fixed size array for the host field in the
  ajp structure. We use that in shm anyways and we
  wouldn't know how to free the dynamic memory, if we
  allocated the host filed fresh during each address update.
- Only use local data copy when displaying config data
  in the status worker. We ensure, that we sync via pull
  if needed, so no need to use the shm data except for
  the volatile runtime statistics data.
- Do not directly write new address data to shm in status
  worker, instead use general push mechanism.
- In status worker ensure that host is always set before
  trying to update address data, even if only port changed.
- Fix display of address data in status worker for port
  equals zero case.

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_lb_worker.c
    tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h
    tomcat/connectors/trunk/jk/native/common/jk_status.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=749685&r1=749684&r2=749685&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c Tue Mar  3 18:38:51 2009
@@ -963,10 +963,16 @@
 }
 
 /* Syncing config values from shm */
-void jk_ajp_pull(ajp_worker_t * aw, jk_logger_t *l)
+void jk_ajp_pull(ajp_worker_t * aw, int locked, jk_logger_t *l)
 {
+    int resolve = JK_FALSE;
+    int port = 0;
+    char host[JK_SHM_STR_SIZ+1];
+    struct sockaddr_in inet_addr;
     JK_TRACE_ENTER(l);
 
+    if (locked == JK_FALSE)
+        jk_shm_lock();
     if (JK_IS_DEBUG_LEVEL(l))
         jk_log(l, JK_LOG_DEBUG,
                "syncing mem for ajp worker '%s' from shm",
@@ -981,15 +987,39 @@
     aw->retry_interval = aw->s->retry_interval;
     aw->max_packet_size = aw->s->max_packet_size;
     aw->sequence = aw->s->h.sequence;
+    if (aw->addr_sequence != aw->s->addr_sequence) {
+        resolve = JK_TRUE;
+        aw->addr_sequence = aw->s->addr_sequence;
+        strncpy(host, aw->s->host, JK_SHM_STR_SIZ);
+        port = aw->s->port;
+    }
+    if (locked == JK_FALSE)
+        jk_shm_unlock();
+
+    if (resolve == JK_TRUE) {
+        if (!jk_resolve(host, port, &inet_addr,
+                        aw->worker.we->pool, l)) {
+            jk_log(l, JK_LOG_ERROR,
+                   "Failed resolving address '%s:%d' for worker '%s'.",
+                   host, port, aw->name);
+        }
+        else {
+            aw->port = port;
+            strncpy(aw->host, host, JK_SHM_STR_SIZ);
+            memcpy(&(aw->worker_inet_addr), &inet_addr, sizeof(inet_addr));
+        }
+    }
 
     JK_TRACE_EXIT(l);
 }
 
 /* Syncing config values to shm */
-void jk_ajp_push(ajp_worker_t * aw, jk_logger_t *l)
+void jk_ajp_push(ajp_worker_t * aw, int locked, jk_logger_t *l)
 {
     JK_TRACE_ENTER(l);
 
+    if (locked == JK_FALSE)
+        jk_shm_lock();
     if (JK_IS_DEBUG_LEVEL(l))
         jk_log(l, JK_LOG_DEBUG,
                "syncing shm for ajp worker '%s' from mem",
@@ -1004,6 +1034,13 @@
     aw->s->retry_interval = aw->retry_interval;
     aw->s->max_packet_size = aw->max_packet_size;
     aw->s->h.sequence = aw->sequence;
+    if (aw->s->addr_sequence != aw->addr_sequence) {
+        aw->s->addr_sequence = aw->addr_sequence;
+        strncpy(aw->s->host, aw->host, JK_SHM_STR_SIZ);
+        aw->s->port = aw->port;
+    }
+    if (locked == JK_FALSE)
+        jk_shm_unlock();
 
     JK_TRACE_EXIT(l);
 }
@@ -2164,23 +2201,8 @@
     p = e->endpoint_private;
     aw = p->worker;
 
-    jk_shm_lock();
     if (aw->sequence != aw->s->h.sequence)
-        jk_ajp_pull(aw, l);
-    if (aw->addr_sequence != aw->s->addr_sequence) {
-        aw->addr_sequence = aw->s->addr_sequence;
-        aw->host = aw->s->host;
-        aw->port = aw->s->port;
-        if (!jk_resolve(aw->host, aw->port, &aw->worker_inet_addr,
-                        aw->worker.we->pool, l)) {
-            if (is_error)
-                *is_error = JK_HTTP_SERVER_ERROR;
-            jk_shm_unlock();
-            JK_TRACE_EXIT(l);
-            return JK_FALSE;
-       }
-    }
-    jk_shm_unlock();
+        jk_ajp_pull(aw, JK_FALSE, l);
 
     aw->s->used++;
 
@@ -2282,10 +2304,8 @@
                        i, retry_interval);
             jk_sleep(retry_interval);
             /* Pull shared memory if something changed during sleep */
-            jk_shm_lock();
             if (aw->sequence != aw->s->h.sequence)
-                jk_ajp_pull(aw, l);
-            jk_shm_unlock();
+                jk_ajp_pull(aw, JK_FALSE, l);
         }
         /*
          * We're using op->request which hold initial request
@@ -2476,10 +2496,10 @@
     if (pThis && pThis->worker_private) {
         ajp_worker_t *p = pThis->worker_private;
         p->port = jk_get_worker_port(props, p->name, port);
-        p->host = jk_get_worker_host(props, p->name, host);
-        if (!p->host) {
-            p->host = "undefined";
+        if (!host) {
+            host = "undefined";
         }
+        strncpy(p->host, jk_get_worker_host(props, p->name, host), JK_SHM_STR_SIZ);
 
         if (JK_IS_DEBUG_LEVEL(l))
             jk_log(l, JK_LOG_DEBUG,

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=749685&r1=749684&r2=749685&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_ajp_common.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_ajp_common.h Tue Mar  3 18:38:51 2009
@@ -273,7 +273,7 @@
 
     struct sockaddr_in worker_inet_addr;    /* Contains host and port */
     unsigned connect_retry_attempts;
-    const char *host;
+    char host[JK_SHM_STR_SIZ+1];
     int port;
     int addr_sequence;  /* Whether the address is resolved */
     int maintain_time;
@@ -422,9 +422,9 @@
 
 void ajp_close_endpoint(ajp_endpoint_t * ae, jk_logger_t *l);
 
-void jk_ajp_pull(ajp_worker_t * aw, jk_logger_t *l);
+void jk_ajp_pull(ajp_worker_t * aw, int locked, jk_logger_t *l);
 
-void jk_ajp_push(ajp_worker_t * aw, jk_logger_t *l);
+void jk_ajp_push(ajp_worker_t * aw, int locked, jk_logger_t *l);
 
 int ajp_connection_tcp_send_message(ajp_endpoint_t * ae,
                                     jk_msg_buf_t *msg, jk_logger_t *l);

Modified: tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c?rev=749685&r1=749684&r2=749685&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c Tue Mar  3 18:38:51 2009
@@ -282,12 +282,14 @@
 }
 
 /* Syncing config values from shm */
-void jk_lb_pull(lb_worker_t *p, jk_logger_t *l)
+void jk_lb_pull(lb_worker_t *p, int locked, jk_logger_t *l)
 {
     unsigned int i = 0;
 
     JK_TRACE_ENTER(l);
 
+    if (locked == JK_FALSE)
+        jk_shm_lock();
     if (JK_IS_DEBUG_LEVEL(l))
         jk_log(l, JK_LOG_DEBUG,
                "syncing mem for lb '%s' from shm",
@@ -316,7 +318,7 @@
                        "syncing mem for member '%s' of lb '%s' from shm",
                        w->name, p->name);
 
-            jk_ajp_pull(aw, l);
+            jk_ajp_pull(aw, JK_TRUE, l);
             strncpy(w->route, w->s->route, JK_SHM_STR_SIZ);
             strncpy(w->domain, w->s->domain, JK_SHM_STR_SIZ);
             strncpy(w->redirect, w->s->redirect, JK_SHM_STR_SIZ);
@@ -327,17 +329,21 @@
             w->sequence = w->s->h.sequence;
         }
     }
+    if (locked == JK_FALSE)
+        jk_shm_unlock();
 
     JK_TRACE_EXIT(l);
 }
 
 /* Syncing config values to shm */
-void jk_lb_push(lb_worker_t *p, jk_logger_t *l)
+void jk_lb_push(lb_worker_t *p, int locked, jk_logger_t *l)
 {
     unsigned int i = 0;
 
     JK_TRACE_ENTER(l);
 
+    if (locked == JK_FALSE)
+        jk_shm_lock();
     if (JK_IS_DEBUG_LEVEL(l))
         jk_log(l, JK_LOG_DEBUG,
                "syncing shm for lb '%s' from mem",
@@ -366,7 +372,7 @@
                        "syncing shm for member '%s' of lb '%s' from mem",
                        w->name, p->name);
 
-            jk_ajp_push(aw, l);
+            jk_ajp_push(aw, JK_TRUE, l);
             strncpy(w->s->route, w->route, JK_SHM_STR_SIZ);
             strncpy(w->s->domain, w->domain, JK_SHM_STR_SIZ);
             strncpy(w->s->redirect, w->redirect, JK_SHM_STR_SIZ);
@@ -377,6 +383,8 @@
             w->s->h.sequence = w->sequence;
         }
     }
+    if (locked == JK_FALSE)
+        jk_shm_unlock();
 
     JK_TRACE_EXIT(l);
 }
@@ -524,7 +532,7 @@
     JK_TRACE_ENTER(l);
 
     if (p->sequence != p->s->h.sequence)
-        jk_lb_pull(p, l);
+        jk_lb_pull(p, JK_TRUE, l);
     for (i = 0; i < p->num_of_workers; i++) {
         w = &p->lb_workers[i];
         aw = (ajp_worker_t *)w->worker->worker_private;
@@ -1054,10 +1062,8 @@
     /* Set returned error to OK */
     *is_error = JK_HTTP_OK;
 
-    jk_shm_lock();
     if (p->worker->sequence != p->worker->s->h.sequence)
-        jk_lb_pull(p->worker, l);
-    jk_shm_unlock();
+        jk_lb_pull(p->worker, JK_FALSE, l);
     for (i = 0; i < num_of_workers; i++) {
         /* Copy the shared state info */
         p->states[i] = p->worker->lb_workers[i].s->state;
@@ -1107,10 +1113,8 @@
                        retry, p->worker->retry_interval);
             jk_sleep(p->worker->retry_interval);
             /* Pull shared memory if something changed during sleep */
-            jk_shm_lock();
             if (p->worker->sequence != p->worker->s->h.sequence)
-                jk_lb_pull(p->worker, l);
-            jk_shm_unlock();
+                jk_lb_pull(p->worker, JK_FALSE, l);
             for (i = 0; i < num_of_workers; i++) {
                 /* Copy the shared state info */
                 p->states[i] = p->worker->lb_workers[i].s->state;
@@ -1663,10 +1667,8 @@
         return JK_FALSE;
     }
 
-    jk_shm_lock();
     p->sequence++;
-    jk_lb_push(p, log);
-    jk_shm_unlock();
+    jk_lb_push(p, JK_FALSE, log);
 
     JK_TRACE_EXIT(log);
     return JK_TRUE;

Modified: tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h?rev=749685&r1=749684&r2=749685&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h Tue Mar  3 18:38:51 2009
@@ -211,8 +211,8 @@
 const char *jk_lb_get_activation(lb_sub_worker_t *p, jk_logger_t *l);
 int jk_lb_get_activation_code(const char *v);
 void reset_lb_values(lb_worker_t *p, jk_logger_t *l);
-void jk_lb_pull(lb_worker_t * p, jk_logger_t *l);
-void jk_lb_push(lb_worker_t * p, jk_logger_t *l);
+void jk_lb_pull(lb_worker_t * p, int locked, jk_logger_t *l);
+void jk_lb_push(lb_worker_t * p, int locked, jk_logger_t *l);
 void update_mult(lb_worker_t * p, jk_logger_t *l);
 
 #ifdef __cplusplus

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=749685&r1=749684&r2=749685&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_status.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_status.c Tue Mar  3 18:38:51 2009
@@ -196,6 +196,7 @@
 #define JK_STATUS_NEEDS_PUSH               0x00000001
 #define JK_STATUS_NEEDS_RESET_LB_VALUES    0x00000002
 #define JK_STATUS_NEEDS_UPDATE_MULT        0x00000004
+#define JK_STATUS_NEEDS_ADDR_PUSH          0x00000008
 
 #define JK_STATUS_WAIT_AFTER_UPDATE        "3"
 #define JK_STATUS_REFRESH_DEF              "10"
@@ -1644,7 +1645,7 @@
     if (aw->port > 0)
         return jk_dump_hinfo(&aw->worker_inet_addr, buf);
     else {
-        if (aw->s->addr_sequence != aw->s->addr_sequence)
+        if (aw->addr_sequence != aw->s->addr_sequence)
             return "unresolved";
         else
             return "invalid";
@@ -1666,7 +1667,7 @@
         jk_printf(s, JK_STATUS_SHOW_MEMBER_CONF_ROW,
                   aw->name,
                   status_worker_type(type),
-                  aw->s->host, aw->s->port,
+                  aw->host, aw->port,
                   dump_ajp_addr(aw, buf),
                   aw->cache_timeout,
                   aw->connect_timeout,
@@ -1678,7 +1679,7 @@
     else
         jk_printf(s, JK_STATUS_SHOW_AJP_CONF_ROW,
                   status_worker_type(type),
-                  aw->s->host, aw->s->port,
+                  aw->host, aw->port,
                   dump_ajp_addr(aw, buf),
                   aw->cache_timeout,
                   aw->connect_timeout,
@@ -1804,8 +1805,8 @@
             jk_print_xml_att_string(s, off+2, "name", ajp_name);
             jk_print_xml_att_string(s, off+2, "type", status_worker_type(aw->worker.type));
         }
-        jk_print_xml_att_string(s, off+2, "host", aw->s->host);
-        jk_print_xml_att_int(s, off+2, "port", aw->s->port);
+        jk_print_xml_att_string(s, off+2, "host", aw->host);
+        jk_print_xml_att_int(s, off+2, "port", aw->port);
         jk_print_xml_att_string(s, off+2, "address", dump_ajp_addr(aw, buf));
         jk_print_xml_att_int(s, off+2, "connection_pool_timeout", aw->cache_timeout);
         jk_print_xml_att_int(s, off+2, "ping_timeout", aw->ping_timeout);
@@ -1863,8 +1864,8 @@
             jk_printf(s, " name=%s", ajp_name);
             jk_printf(s, " type=%s", status_worker_type(aw->worker.type));
         }
-        jk_printf(s, " host=%s", aw->s->host);
-        jk_printf(s, " port=%d", aw->s->port);
+        jk_printf(s, " host=%s", aw->host);
+        jk_printf(s, " port=%d", aw->port);
         jk_printf(s, " address=%s", dump_ajp_addr(aw, buf));
         jk_printf(s, " connection_pool_timeout=%d", aw->cache_timeout);
         jk_printf(s, " ping_timeout=%d", aw->ping_timeout);
@@ -1919,8 +1920,8 @@
             jk_print_prop_att_string(s, w, name, "list", ajp_name);
             jk_print_prop_att_string(s, w, ajp_name, "type", status_worker_type(aw->worker.type));
         }
-        jk_print_prop_att_string(s, w, ajp_name, "host", aw->s->host);
-        jk_print_prop_att_int(s, w, ajp_name, "port", aw->s->port);
+        jk_print_prop_att_string(s, w, ajp_name, "host", aw->host);
+        jk_print_prop_att_int(s, w, ajp_name, "port", aw->port);
         jk_print_prop_att_string(s, w, ajp_name, "address", dump_ajp_addr(aw, buf));
         jk_print_prop_att_int(s, w, ajp_name, "connection_pool_timeout", aw->cache_timeout);
         jk_print_prop_att_int(s, w, ajp_name, "ping_timeout", aw->ping_timeout);
@@ -2018,10 +2019,8 @@
         single = 1;
     }
 
-    jk_shm_lock();
     if (lb->sequence != lb->s->h.sequence)
-        jk_lb_pull(lb, l);
-    jk_shm_unlock();
+        jk_lb_pull(lb, JK_FALSE, l);
 
     for (j = 0; j < lb->num_of_workers; j++) {
         lb_sub_worker_t *wr = &(lb->lb_workers[j]);
@@ -2413,10 +2412,8 @@
         single = 1;
     }
 
-    jk_shm_lock();
     if (aw->sequence != aw->s->h.sequence)
-        jk_ajp_pull(aw, l);
-    jk_shm_unlock();
+        jk_ajp_pull(aw, JK_FALSE, l);
 
     map_count = count_maps(s, name, l);
 
@@ -2710,11 +2707,11 @@
     jk_putv(s, "<tr><td>", JK_STATUS_ARG_AJP_TEXT_HOST_STR,
             ":</td><td><input name=\"",
             JK_STATUS_ARG_AJP_HOST_STR, "\" type=\"text\" ", NULL);
-    jk_printf(s, "value=\"%s\"/></td></tr>\n", aw->s->host);
+    jk_printf(s, "value=\"%s\"/></td></tr>\n", aw->host);
     jk_putv(s, "<tr><td>", JK_STATUS_ARG_AJP_TEXT_PORT_INT,
             ":</td><td><input name=\"",
             JK_STATUS_ARG_AJP_PORT_INT, "\" type=\"text\" ", NULL);
-    jk_printf(s, "value=\"%d\"/></td></tr>\n", aw->s->port);
+    jk_printf(s, "value=\"%d\"/></td></tr>\n", aw->port);
 
     jk_putv(s, "<tr><td>", JK_STATUS_ARG_AJP_TEXT_CACHE_TO,
             ":</td><td><input name=\"",
@@ -3058,7 +3055,7 @@
     }
     if (sync_needed == JK_TRUE) {
         lb->sequence++;
-        jk_lb_push(lb, l);
+        jk_lb_push(lb, JK_TRUE, l);
     }
 }
 
@@ -3133,7 +3130,7 @@
     int rv;
     int i;
     int old;
-    int as = 0;
+    int resolve = JK_FALSE;
     char host[JK_SHM_STR_SIZ+1];
     int  port = 0;
 
@@ -3222,26 +3219,24 @@
             }
         }
     }
+    port = aw->port;
+    if (set_int_if_changed(p, aw->name, "port", JK_STATUS_ARG_AJP_PORT_INT,
+                           0, INT_MAX, &port, lb_name, l)) {
+        strncpy(host, aw->host, JK_SHM_STR_SIZ);
+        resolve = JK_TRUE;
+    }
     if ((rv = status_get_string(p, JK_STATUS_ARG_AJP_HOST_STR,
                                 NULL, &arg, l)) == JK_TRUE) {
-        if (strncmp(aw->s->host, arg, JK_SHM_STR_SIZ)) {
+        if (strncmp(aw->host, arg, JK_SHM_STR_SIZ)) {
             jk_log(l, JK_LOG_INFO,
                     "Status worker '%s' setting 'host' for sub worker '%s' to '%s'",
                     w->name, aw->name, arg);
             strncpy(host, arg, JK_SHM_STR_SIZ);
-            *side_effect |= JK_STATUS_NEEDS_PUSH;
-            as = 1;
+            resolve = JK_TRUE;
         }
     }
-    port = aw->s->port;
-    if (set_int_if_changed(p, aw->name, "port", JK_STATUS_ARG_AJP_PORT_INT,
-                           0, INT_MAX, &port, lb_name, l)) {
-        *side_effect |= JK_STATUS_NEEDS_PUSH;
-        as = 1;
-    }
-    if (as) {
+    if (resolve == JK_TRUE) {
         struct sockaddr_in inet_addr;
-        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'.";
@@ -3249,17 +3244,15 @@
             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'.",
-                   w->name, aw->name, host, port);
+                   "Status worker '%s' failed resolving address '%s:%d' for sub worker '%s'.",
+                   w->name, host, port, aw->name);
             rc = JK_FALSE;
         }
         else {
-            strcpy(aw->s->host, host);
             aw->port = port;
-            aw->s->addr_sequence += as;
-            aw->host = aw->s->host;
-            aw->addr_sequence = aw->s->addr_sequence;
+            strncpy(aw->host, host, JK_SHM_STR_SIZ);
             memcpy(&(aw->worker_inet_addr), &inet_addr, sizeof(inet_addr));
+            *side_effect |= JK_STATUS_NEEDS_PUSH | JK_STATUS_NEEDS_ADDR_PUSH;
         }
     }
     if (set_int_if_changed(p, aw->name, "ping_timeout", JK_STATUS_ARG_AJP_PING_TO,
@@ -3531,7 +3524,7 @@
             update_mult(lb, l);
         if (rc) {
             lb->sequence++;
-            jk_lb_push(lb, l);
+            jk_lb_push(lb, JK_TRUE, l);
         }
     }
     JK_TRACE_EXIT(l);
@@ -3881,10 +3874,8 @@
             return JK_FALSE;
         }
 
-        jk_shm_lock();
         if (lb->sequence != lb->s->h.sequence)
-            jk_lb_pull(lb, l);
-        jk_shm_unlock();
+            jk_lb_pull(lb, JK_FALSE, l);
         if (!sub_worker || !sub_worker[0]) {
             const char *arg;
             if (status_get_string(p, JK_STATUS_ARG_ATTRIBUTE,
@@ -3929,10 +3920,8 @@
                 jk_log(l, JK_LOG_DEBUG,
                        "Status worker '%s' %s ajp worker '%s'",
                        w->name, "editing", aw->name);
-            jk_shm_lock();
             if (aw->sequence != aw->s->h.sequence)
-                jk_ajp_pull(aw, l);
-            jk_shm_unlock();
+                jk_ajp_pull(aw, JK_FALSE, l);
             form_member(s, p, NULL, aw, worker, l);
             JK_TRACE_EXIT(l);
             return JK_TRUE;
@@ -3981,7 +3970,7 @@
         }
 
         if (lb->sequence != lb->s->h.sequence)
-            jk_lb_pull(lb, l);
+            jk_lb_pull(lb, JK_TRUE, l);
         if (!sub_worker || !sub_worker[0]) {
             const char *arg;
             if (status_get_string(p, JK_STATUS_ARG_ATTRIBUTE,
@@ -4031,10 +4020,13 @@
                        w->name, "updating", lb->name, wr->name);
                 aw = (ajp_worker_t *)wr->worker->worker_private;
                 rc = commit_member(s, p, lb, wr, aw, &rv, l);
-                if (rv & JK_STATUS_NEEDS_PUSH) {
+                if (rv & JK_STATUS_NEEDS_ADDR_PUSH) {
+                    aw->addr_sequence++;
+                }
+                if (rv & (JK_STATUS_NEEDS_PUSH | JK_STATUS_NEEDS_ADDR_PUSH)) {
                     wr->sequence++;
                     lb->sequence++;
-                    jk_lb_push(lb, l);
+                    jk_lb_push(lb, JK_TRUE, l);
                 }
                 if (rv & JK_STATUS_NEEDS_RESET_LB_VALUES)
                     reset_lb_values(lb, l);
@@ -4075,11 +4067,11 @@
                        "Status worker '%s' %s ajp worker '%s'",
                        w->name, "updating", aw->name);
             if (aw->sequence != aw->s->h.sequence)
-                jk_ajp_pull(aw, l);
+                jk_ajp_pull(aw, JK_TRUE, l);
             rc = commit_member(s, p, NULL, NULL, aw, &rv, l);
             if (rv & JK_STATUS_NEEDS_PUSH) {
                 aw->sequence++;
-                jk_ajp_push(aw, l);
+                jk_ajp_push(aw, JK_TRUE, l);
             }
             JK_TRACE_EXIT(l);
             return rc;



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


Mime
View raw message