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/06 15:00:05 UTC

svn commit: r609310 - in /tomcat/connectors/trunk/jk: native/apache-1.3/mod_jk.c native/apache-2.0/mod_jk.c native/iis/jk_isapi_plugin.c native/netscape/jk_nsapi_plugin.c xdocs/miscellaneous/changelog.xml

Author: rjung
Date: Sun Jan  6 06:00:03 2008
New Revision: 609310

URL: http://svn.apache.org/viewvc?rev=609310&view=rev
Log:
Make open/attach logging for shm consistent for all web servers.

Modified:
    tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
    tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
    tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c
    tomcat/connectors/trunk/jk/native/netscape/jk_nsapi_plugin.c
    tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml

Modified: tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c?rev=609310&r1=609309&r2=609310&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c Sun Jan  6 06:00:03 2008
@@ -2655,12 +2655,7 @@
     }
 #endif
 
-    if ((rc = jk_shm_open(jk_shm_file, jk_shm_size, conf->log)) == 0) {
-        if (JK_IS_DEBUG_LEVEL(conf->log))
-            jk_log(conf->log, JK_LOG_DEBUG, "Initialized shm:%s (%d bytes)",
-                   jk_shm_name(), (int) jk_shm_size, rc);
-    }
-    else
+    if ((rc = jk_shm_open(jk_shm_file, jk_shm_size, conf->log)) != 0)
         jk_log(conf->log, JK_LOG_ERROR,
                "Initializing shm:%s errno=%d. Load balancing workers will not function properly.",
                jk_shm_name(), rc);
@@ -2959,12 +2954,7 @@
 
     JK_TRACE_ENTER(conf->log);
 
-    if ((rc = jk_shm_attach(jk_shm_file, jk_shm_size, conf->log)) == 0) {
-        if (JK_IS_DEBUG_LEVEL(conf->log))
-            jk_log(conf->log, JK_LOG_DEBUG, "Attached shm:%s (%d bytes)",
-                   jk_shm_name(), (int) jk_shm_size);
-    }
-    else
+    if ((rc = jk_shm_attach(jk_shm_file, jk_shm_size, conf->log)) != 0)
         jk_log(conf->log, JK_LOG_ERROR, "Attaching shm:%s errno=%d",
                jk_shm_name(), rc);
 

Modified: tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c?rev=609310&r1=609309&r2=609310&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c Sun Jan  6 06:00:03 2008
@@ -2715,11 +2715,8 @@
     JK_TRACE_ENTER(conf->log);
 
     if ((rc = jk_shm_attach(jk_shm_file, jk_shm_size, conf->log)) == 0) {
-        if (JK_IS_DEBUG_LEVEL(conf->log))
-            jk_log(conf->log, JK_LOG_DEBUG, "Attached shm:%s (%d bytes)",
-                   jk_shm_name(), (int) jk_shm_size);
-            apr_pool_cleanup_register(pconf, conf->log, jk_cleanup_shmem,
-                                     jk_cleanup_shmem);
+        apr_pool_cleanup_register(pconf, conf->log, jk_cleanup_shmem,
+                                  jk_cleanup_shmem);
     }
     else
         jk_log(conf->log, JK_LOG_ERROR, "Attaching shm:%s errno=%d",
@@ -2760,11 +2757,8 @@
     }
 #endif
     if ((rc = jk_shm_open(jk_shm_file, jk_shm_size, conf->log)) == 0) {
-        if (JK_IS_DEBUG_LEVEL(conf->log))
-            jk_log(conf->log, JK_LOG_DEBUG, "Initialized shm:%s (%d bytes)",
-                   jk_shm_name(), (int) jk_shm_size, rc);
-            apr_pool_cleanup_register(pconf, conf->log, jk_cleanup_shmem,
-                                      jk_cleanup_shmem);
+        apr_pool_cleanup_register(pconf, conf->log, jk_cleanup_shmem,
+                                  jk_cleanup_shmem);
     }
     else
         jk_log(conf->log, JK_LOG_ERROR,

Modified: tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c?rev=609310&r1=609309&r2=609310&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c (original)
+++ tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c Sun Jan  6 06:00:03 2008
@@ -1656,6 +1656,7 @@
 {
     char shm_name[MAX_PATH];
     int rc = JK_FALSE;
+    int rv;
 
     if (!jk_open_file_logger(&logger, log_file, log_level)) {
         logger = NULL;
@@ -1674,7 +1675,11 @@
     /*
      * Create named shared memory for each server
      */
-    jk_shm_open(shm_name, shm_config_size, logger);
+    if ((rv = jk_shm_open(shm_name, shm_config_size, logger)) != 0) {
+        jk_log(logger, JK_LOG_ERROR,
+               "Initializing shm:%s errno=%d. Load balancing workers will not function properly.",
+               jk_shm_name(), rv);
+    }
 
     jk_set_worker_def_cache_size(DEFAULT_WORKER_THREADS);
 

Modified: tomcat/connectors/trunk/jk/native/netscape/jk_nsapi_plugin.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/netscape/jk_nsapi_plugin.c?rev=609310&r1=609309&r2=609310&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/netscape/jk_nsapi_plugin.c (original)
+++ tomcat/connectors/trunk/jk/native/netscape/jk_nsapi_plugin.c Sun Jan  6 06:00:03 2008
@@ -233,6 +233,7 @@
     char *reject_unsafe = pblock_findval(REJECT_UNSAFE_TAG, pb);
 
     int rc = REQ_ABORTED;
+    int rv;
 
     if (!worker_prp_file) {
         worker_prp_file = JK_WORKER_FILE_DEF;
@@ -268,7 +269,11 @@
         logger = NULL;
     }
     
-    jk_shm_open(shm_file, JK_SHM_DEF_SIZE, logger);
+    if ((rv = jk_shm_open(shm_file, JK_SHM_DEF_SIZE, logger)) != 0) {
+        jk_log(logger, JK_LOG_ERROR,
+               "Initializing shm:%s errno=%d. Load balancing workers will not function properly.",
+               jk_shm_name(), rv);
+    }
     if (jk_map_alloc(&init_map)) {
         if (jk_map_read_properties(init_map, worker_prp_file, NULL,
                                    JK_MAP_HANDLE_DUPLICATES, logger)) {

Modified: tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml?rev=609310&r1=609309&r2=609310&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml (original)
+++ tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml Sun Jan  6 06:00:03 2008
@@ -44,6 +44,9 @@
   <subsection name="Native">
     <changelog>
       <update>
+        SHM: Make open/attach logging consistent for all web servers. (rjung)
+      </update>
+      <update>
         Status: Include server local time in output. (rjung)
       </update>
       <fix>



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