You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by rj...@apache.org on 2008/01/07 20:51:17 UTC

svn commit: r609760 - in /tomcat/connectors/trunk/jk: native/common/ xdocs/miscellaneous/

Author: rjung
Date: Mon Jan  7 11:51:15 2008
New Revision: 609760

URL: http://svn.apache.org/viewvc?rev=609760&view=rev
Log:
Refactor "retries", remove from service and jk_worker,
move into ajp worker instead, because we don't actually
use it in the other jk workers.

Modified:
    tomcat/connectors/trunk/jk/native/common/jk_ajp12_worker.c
    tomcat/connectors/trunk/jk/native/common/jk_ajp13_worker.c
    tomcat/connectors/trunk/jk/native/common/jk_ajp14_worker.c
    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_jni_worker.c
    tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c
    tomcat/connectors/trunk/jk/native/common/jk_service.h
    tomcat/connectors/trunk/jk/native/common/jk_status.c
    tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml

Modified: tomcat/connectors/trunk/jk/native/common/jk_ajp12_worker.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_ajp12_worker.c?rev=609760&r1=609759&r2=609760&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_ajp12_worker.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_ajp12_worker.c Mon Jan  7 11:51:15 2008
@@ -280,7 +280,6 @@
                 private_data->worker.get_endpoint = get_endpoint;
                 private_data->worker.destroy = destroy;
                 private_data->worker.maintain = NULL;
-                private_data->worker.retries = JK_RETRIES;
 
                 *w = &private_data->worker;
                 return JK_AJP12_WORKER_TYPE;

Modified: tomcat/connectors/trunk/jk/native/common/jk_ajp13_worker.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_ajp13_worker.c?rev=609760&r1=609759&r2=609760&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_ajp13_worker.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_ajp13_worker.c Mon Jan  7 11:51:15 2008
@@ -44,12 +44,8 @@
                           jk_worker_env_t *we, jk_logger_t *l)
 {
     int rc;
-    ajp_worker_t *aw = ( ajp_worker_t *)pThis->worker_private;
     JK_TRACE_ENTER(l);
 
-    pThis->retries = jk_get_worker_retries(props, aw->name,
-                                           JK_RETRIES);
-
     rc = ajp_init(pThis, props, we, l, AJP13_PROTO);
     JK_TRACE_EXIT(l);
     return rc;
@@ -110,7 +106,6 @@
     aw->worker.get_endpoint = get_endpoint;
     aw->worker.destroy = destroy;
     aw->worker.maintain = ajp_maintain;
-    aw->worker.retries = JK_RETRIES;
 
     aw->logon = NULL;           /* No Logon on AJP13 */
 

Modified: tomcat/connectors/trunk/jk/native/common/jk_ajp14_worker.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_ajp14_worker.c?rev=609760&r1=609759&r2=609760&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_ajp14_worker.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_ajp14_worker.c Mon Jan  7 11:51:15 2008
@@ -307,8 +307,6 @@
         return JK_FALSE;
     }
     aw = pThis->worker_private;
-    pThis->retries = jk_get_worker_retries(props, aw->name,
-                                           JK_RETRIES);
 
     /* Set Secret Key (used at logon time) */
     aw->login->secret_key = jk_get_worker_secret_key(props, aw->name);
@@ -425,7 +423,6 @@
     aw->worker.get_endpoint = get_endpoint;
     aw->worker.destroy = destroy;
     aw->worker.maintain = ajp_maintain;
-    aw->worker.retries = JK_RETRIES;
 
     aw->logon = logon;          /* LogOn Handler for AJP14 */
     *w = &aw->worker;

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=609760&r1=609759&r2=609760&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c Mon Jan  7 11:51:15 2008
@@ -2065,9 +2065,9 @@
 
     if (JK_IS_DEBUG_LEVEL(l)) {
         jk_log(l, JK_LOG_DEBUG, "processing %s with %d retries",
-               p->worker->name, p->worker->worker.retries);
+               p->worker->name, p->worker->retries);
     }
-    for (i = 0; i < p->worker->worker.retries; i++) {
+    for (i = 0; i < p->worker->retries; i++) {
         /*
          * We're using op->request which hold initial request
          * if Tomcat is stopped or restarted, we will pass op->request
@@ -2375,6 +2375,11 @@
         p->recovery_opts =
             jk_get_worker_recovery_opts(props, p->name,
                                         AJP_DEF_RECOVERY_OPTS);
+
+        p->retries =
+            jk_get_worker_retries(props, p->name,
+                                  JK_RETRIES);
+
         p->max_packet_size =
             jk_get_max_packet_size(props, p->name);
 
@@ -2382,14 +2387,11 @@
                                      &p->http_status_fail[0],
                                      JK_MAX_HTTP_STATUS_FAILS);
 
-        pThis->retries =
-            jk_get_worker_retries(props, p->name,
-                                  JK_RETRIES);
-        if (pThis->retries < 1) {
+        if (p->retries < 1) {
             jk_log(l, JK_LOG_INFO,
                    "number of retries must be greater then 1. Setting to default=%d",
                    JK_RETRIES);
-            pThis->retries = JK_RETRIES;
+            p->retries = JK_RETRIES;
         }
 
         if (JK_IS_DEBUG_LEVEL(l)) {
@@ -2431,7 +2433,7 @@
 
             jk_log(l, JK_LOG_DEBUG,
                    "retries:          %d",
-                    pThis->retries);
+                    p->retries);
 
             jk_log(l, JK_LOG_DEBUG,
                    "max packet size:  %d",

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=609760&r1=609759&r2=609760&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_ajp_common.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_ajp_common.h Mon Jan  7 11:51:15 2008
@@ -288,6 +288,12 @@
      */
     unsigned int recovery_opts;
     
+    /*
+     * Public property to enable the number of retry attempts
+     * on this worker.
+     */
+    int retries;
+
     unsigned int max_packet_size;  /*  Maximum AJP Packet size */
     
     /* 

Modified: tomcat/connectors/trunk/jk/native/common/jk_jni_worker.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_jni_worker.c?rev=609760&r1=609759&r2=609760&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_jni_worker.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_jni_worker.c Mon Jan  7 11:51:15 2008
@@ -710,7 +710,6 @@
     private_data->worker.init = init;
     private_data->worker.get_endpoint = get_endpoint;
     private_data->worker.destroy = destroy;
-    private_data->worker.retries = JK_RETRIES;
 
     *w = &private_data->worker;
     the_singleton_jni_worker = &private_data->worker;

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=609760&r1=609759&r2=609760&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c Mon Jan  7 11:51:15 2008
@@ -1423,9 +1423,8 @@
     lb_worker_t *p = (lb_worker_t *)pThis->worker_private;
     JK_TRACE_ENTER(log);
 
-    pThis->retries = jk_get_worker_retries(props, p->s->name,
-                                           JK_RETRIES);
-    p->retries = pThis->retries;
+    p->retries = jk_get_worker_retries(props, p->s->name,
+                                       JK_RETRIES);
     p->recover_wait_time = jk_get_worker_recover_timeout(props, p->s->name,
                                                             WAIT_BEFORE_RECOVER);
     if (p->recover_wait_time < 1)
@@ -1533,7 +1532,6 @@
         private_data->worker.get_endpoint = get_endpoint;
         private_data->worker.destroy = destroy;
         private_data->worker.maintain = maintain_workers;
-        private_data->worker.retries = JK_RETRIES;
         private_data->recover_wait_time = WAIT_BEFORE_RECOVER;
         private_data->max_reply_timeouts = 0;
         private_data->sequence = 0;

Modified: tomcat/connectors/trunk/jk/native/common/jk_service.h
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_service.h?rev=609760&r1=609759&r2=609760&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_service.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_service.h Mon Jan  7 11:51:15 2008
@@ -412,11 +412,6 @@
 {
 
     /*
-     * Public property to enable the number of retry attempts
-     * on this worker.
-     */
-    int retries;
-    /*
      * A 'this' pointer which is used by the subclasses of this class to
      * point to data/functions which are specific to a given protocol
      * (e.g. ajp12 or ajp13 or ajp14).

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=609760&r1=609759&r2=609760&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_status.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_status.c Mon Jan  7 11:51:15 2008
@@ -3814,7 +3814,6 @@
         private_data->worker.init = init;
         private_data->worker.get_endpoint = get_endpoint;
         private_data->worker.destroy = destroy;
-        private_data->worker.retries = 1;
 
         *w = &private_data->worker;
         JK_TRACE_EXIT(l);

Modified: tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml?rev=609760&r1=609759&r2=609760&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml (original)
+++ tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml Mon Jan  7 11:51:15 2008
@@ -44,6 +44,10 @@
   <subsection name="Native">
     <changelog>
       <update>
+        Common: Refactor "retries", remove from service and jk_worker,
+        move into ajp worker instead. (rjung)
+      </update>
+      <update>
         SHM: Use distinct structs for lb and ajp13 in shm.
         Improves type safety and saves a few bytes. (rjung)
       </update>



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