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 2007/03/11 16:03:10 UTC
svn commit: r516916 - in /tomcat/connectors/trunk/jk/native:
apache-1.3/mod_jk.c apache-2.0/mod_jk.c
Author: rjung
Date: Sun Mar 11 08:03:10 2007
New Revision: 516916
URL: http://svn.apache.org/viewvc?view=rev&rev=516916
Log:
- simplify logic for shm open error log message
- make code betwenn apache 1.3 and 2.0 more consistent around wc_open()
- add a better log message, in case wc_open() fails
Modified:
tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
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?view=diff&rev=516916&r1=516915&r2=516916
==============================================================================
--- tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c Sun Mar 11 08:03:10 2007
@@ -2513,14 +2513,9 @@
jk_shm_name(), rc);
}
else
- jk_log(conf->log, JK_LOG_ERROR, "Initializing shm:%s errno=%d",
+ jk_log(conf->log, JK_LOG_ERROR,
+ "Initializing shm:%s errno=%d. Load balancing workers will not function properly.",
jk_shm_name(), rc);
-#if !defined(WIN32) && !defined(NETWARE)
- if (!jk_shm_file)
- ap_log_error(APLOG_MARK, APLOG_EMERG | APLOG_NOERRNO, s,
- "No JkShmFile defined in httpd.conf. "
- "LoadBalancer will not function properly!");
-#endif
/* SREVILAK -- register cleanup handler to clear resources on restart,
* to make sure log file gets closed in the parent process */
@@ -2549,24 +2544,30 @@
jk_error_exit(APLOG_MARK, APLOG_EMERG | APLOG_NOERRNO, s, p, "Error in reading worker properties");
}
-#if MODULE_MAGIC_NUMBER >= 19980527
- /* Tell apache we're here */
- ap_add_version_component(JK_EXPOSED_VERSION);
-#endif
if (jk_map_resolve_references(init_map, "worker.", 1, 1, conf->log) == JK_FALSE) {
- jk_error_exit(APLOG_MARK, APLOG_EMERG, s, p, "Error in resolving configuration references");
+ jk_error_exit(APLOG_MARK, APLOG_EMERG | APLOG_NOERRNO, s, p,
+ "Error in resolving configuration references");
}
/* we add the URI->WORKER MAP since workers using AJP14 will feed it */
worker_env.uri_to_worker = conf->uw_map;
worker_env.virtual = "*"; /* for now */
worker_env.server_name = (char *)ap_get_server_version();
- if (wc_open(init_map, &worker_env, conf->log))
+
+ if (wc_open(init_map, &worker_env, conf->log)) {
+#if MODULE_MAGIC_NUMBER >= 19980527
+ /* Tell apache we're here */
+ ap_add_version_component(JK_EXPOSED_VERSION);
+#endif
return;
+ }
+ else {
+ ap_log_error(APLOG_MARK, APLOG_ERR, s,
+ "Error in creating the workers."
+ " Please consult your mod_jk log file '%s'.", conf->log_file);
+ }
- ap_log_error(APLOG_MARK, APLOG_ERR, s,
- "Error while opening the workers, jk will not work");
}
/*
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?view=diff&rev=516916&r1=516915&r2=516916
==============================================================================
--- tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c Sun Mar 11 08:03:10 2007
@@ -2634,18 +2634,9 @@
jk_cleanup_shmem);
}
else
- jk_log(conf->log, JK_LOG_ERROR, "Initializing shm:%s errno=%d",
+ jk_log(conf->log, JK_LOG_ERROR,
+ "Initializing shm:%s errno=%d. Load balancing workers will not function properly.",
jk_shm_name(), rc);
-#if !defined(WIN32) && !defined(NETWARE)
- if (!jk_shm_file) {
- ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_CRIT, 0, NULL,
- "No JkShmFile defined in httpd.conf. "
- "LoadBalancer will not function properly!");
- ap_log_error(APLOG_MARK, APLOG_EMERG, 0, NULL,
- "No JkShmFile defined in httpd.conf. "
- "LoadBalancer will not function properly!");
- }
-#endif
/* Set default connection cache size for multi-threaded MPMs */
if (ap_mpm_query(AP_MPMQ_IS_THREADED, &is_threaded) == APR_SUCCESS &&
@@ -2684,8 +2675,15 @@
#else
worker_env.server_name = (char *)ap_get_server_version();
#endif
+
if (wc_open(init_map, &worker_env, conf->log)) {
ap_add_version_component(pconf, JK_EXPOSED_VERSION);
+ }
+ else {
+ ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s,
+ "Error in creating the workers."
+ " Please consult your mod_jk log file '%s'.", conf->log_file);
+ return !OK;
}
return OK;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org