JBoss Native SVN: r1757 - trunk/mod_cluster/native/mod_proxy_cluster.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-07-24 03:10:25 -0400 (Thu, 24 Jul 2008)
New Revision: 1757
Added:
trunk/mod_cluster/native/mod_proxy_cluster/config.m4.patch
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_ajp.patch
Removed:
trunk/mod_cluster/native/mod_proxy_cluster/patch.txt
Log:
Arrange the patch logic.
Added: trunk/mod_cluster/native/mod_proxy_cluster/config.m4.patch
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/config.m4.patch (rev 0)
+++ trunk/mod_cluster/native/mod_proxy_cluster/config.m4.patch 2008-07-24 07:10:25 UTC (rev 1757)
@@ -0,0 +1,28 @@
+Index: config.m4
+===================================================================
+--- config.m4 (revision 663923)
++++ config.m4 (working copy)
+@@ -18,6 +18,7 @@
+ proxy_http_objs="mod_proxy_http.lo"
+ proxy_ajp_objs="mod_proxy_ajp.lo ajp_header.lo ajp_link.lo ajp_msg.lo ajp_utils.lo"
+ proxy_balancer_objs="mod_proxy_balancer.lo"
++proxy_cluster_objs="mod_proxy_cluster.lo"
+
+ case "$host" in
+ *os2*)
+@@ -28,6 +29,7 @@
+ proxy_http_objs="$proxy_http_objs mod_proxy.la"
+ proxy_ajp_objs="$proxy_ajp_objs mod_proxy.la"
+ proxy_balancer_objs="$proxy_balancer_objs mod_proxy.la"
++ proxy_cluster_objs="$proxy_cluster_objs mod_proxy.la"
+ ;;
+ esac
+
+@@ -36,6 +38,7 @@
+ APACHE_MODULE(proxy_http, Apache proxy HTTP module, $proxy_http_objs, , $proxy_mods_enable)
+ APACHE_MODULE(proxy_ajp, Apache proxy AJP module, $proxy_ajp_objs, , $proxy_mods_enable)
+ APACHE_MODULE(proxy_balancer, Apache proxy BALANCER module, $proxy_balancer_objs, , $proxy_mods_enable)
++APACHE_MODULE(proxy_cluster, proxy CLUSTER module, $proxy_cluster_objs, , $proxy_mods_enable)
+
+ APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/$modpath_current/../generators])
+
Added: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_ajp.patch
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_ajp.patch (rev 0)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_ajp.patch 2008-07-24 07:10:25 UTC (rev 1757)
@@ -0,0 +1,49 @@
+--- mod_proxy_ajp.c 2008-06-18 17:23:06.000000000 +0200
++++ mod_proxy_ajp.c 2008-06-18 15:41:03.000000000 +0200
+@@ -550,6 +550,8 @@
+ conn_rec *origin = NULL;
+ proxy_conn_rec *backend = NULL;
+ const char *scheme = "AJP";
++ apr_interval_time_t savetimeout;
++ char savetimeout_set;
+ proxy_dir_conf *dconf = ap_get_module_config(r->per_dir_config,
+ &proxy_module);
+
+@@ -605,7 +607,18 @@
+ goto cleanup;
+
+ /* Step Two: Make the Connection */
+- if (ap_proxy_connect_backend(scheme, backend, worker, r->server)) {
++ if (worker->ping_timeout_set) {
++ savetimeout_set = worker->timeout_set;
++ savetimeout = worker->timeout;
++ worker->timeout_set = 1;
++ worker->timeout = worker->ping_timeout;
++ }
++ status = ap_proxy_connect_backend(scheme, backend, worker, r->server);
++ if (worker->ping_timeout_set) {
++ worker->timeout_set = savetimeout_set;
++ worker->timeout = savetimeout;
++ }
++ if (status) {
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
+ "proxy: AJP: failed to make connection to backend: %s",
+ backend->hostname);
+@@ -615,6 +628,17 @@
+
+ /* Handle CPING/CPONG */
+ if (worker->ping_timeout_set) {
++ /* Put a timeout on the socket like ap_proxy_connect_backend() */
++ if (worker->timeout_set == 1) {
++ apr_socket_timeout_set(backend->sock, worker->timeout);
++ }
++ else if (conf->timeout_set == 1) {
++ apr_socket_timeout_set(backend->sock, conf->timeout);
++ }
++ else {
++ apr_socket_timeout_set(backend->sock, r->server->timeout);
++ }
++
+
+ status = ajp_handle_cping_cpong(backend->sock, r,
+ worker->ping_timeout);
Deleted: trunk/mod_cluster/native/mod_proxy_cluster/patch.txt
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/patch.txt 2008-07-23 14:17:15 UTC (rev 1756)
+++ trunk/mod_cluster/native/mod_proxy_cluster/patch.txt 2008-07-24 07:10:25 UTC (rev 1757)
@@ -1,77 +0,0 @@
-Index: config.m4
-===================================================================
---- config.m4 (revision 663923)
-+++ config.m4 (working copy)
-@@ -18,6 +18,7 @@
- proxy_http_objs="mod_proxy_http.lo"
- proxy_ajp_objs="mod_proxy_ajp.lo ajp_header.lo ajp_link.lo ajp_msg.lo ajp_utils.lo"
- proxy_balancer_objs="mod_proxy_balancer.lo"
-+proxy_cluster_objs="mod_proxy_cluster.lo"
-
- case "$host" in
- *os2*)
-@@ -28,6 +29,7 @@
- proxy_http_objs="$proxy_http_objs mod_proxy.la"
- proxy_ajp_objs="$proxy_ajp_objs mod_proxy.la"
- proxy_balancer_objs="$proxy_balancer_objs mod_proxy.la"
-+ proxy_cluster_objs="$proxy_cluster_objs mod_proxy.la"
- ;;
- esac
-
-@@ -36,6 +38,7 @@
- APACHE_MODULE(proxy_http, Apache proxy HTTP module, $proxy_http_objs, , $proxy_mods_enable)
- APACHE_MODULE(proxy_ajp, Apache proxy AJP module, $proxy_ajp_objs, , $proxy_mods_enable)
- APACHE_MODULE(proxy_balancer, Apache proxy BALANCER module, $proxy_balancer_objs, , $proxy_mods_enable)
-+APACHE_MODULE(proxy_cluster, proxy CLUSTER module, $proxy_cluster_objs, , $proxy_mods_enable)
-
- APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/$modpath_current/../generators])
-
---- mod_proxy_ajp.c 2008-06-18 17:23:06.000000000 +0200
-+++ mod_proxy_ajp.c 2008-06-18 15:41:03.000000000 +0200
-@@ -550,6 +550,8 @@
- conn_rec *origin = NULL;
- proxy_conn_rec *backend = NULL;
- const char *scheme = "AJP";
-+ apr_interval_time_t savetimeout;
-+ char savetimeout_set;
- proxy_dir_conf *dconf = ap_get_module_config(r->per_dir_config,
- &proxy_module);
-
-@@ -605,7 +607,18 @@
- goto cleanup;
-
- /* Step Two: Make the Connection */
-- if (ap_proxy_connect_backend(scheme, backend, worker, r->server)) {
-+ if (worker->ping_timeout_set) {
-+ savetimeout_set = worker->timeout_set;
-+ savetimeout = worker->timeout;
-+ worker->timeout_set = 1;
-+ worker->timeout = worker->ping_timeout;
-+ }
-+ status = ap_proxy_connect_backend(scheme, backend, worker, r->server);
-+ if (worker->ping_timeout_set) {
-+ worker->timeout_set = savetimeout_set;
-+ worker->timeout = savetimeout;
-+ }
-+ if (status) {
- ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
- "proxy: AJP: failed to make connection to backend: %s",
- backend->hostname);
-@@ -615,6 +628,17 @@
-
- /* Handle CPING/CPONG */
- if (worker->ping_timeout_set) {
-+ /* Put a timeout on the socket like ap_proxy_connect_backend() */
-+ if (worker->timeout_set == 1) {
-+ apr_socket_timeout_set(backend->sock, worker->timeout);
-+ }
-+ else if (conf->timeout_set == 1) {
-+ apr_socket_timeout_set(backend->sock, conf->timeout);
-+ }
-+ else {
-+ apr_socket_timeout_set(backend->sock, r->server->timeout);
-+ }
-+
-
- status = ajp_handle_cping_cpong(backend->sock, r,
- worker->ping_timeout);
16 years, 5 months
JBoss Native SVN: r1756 - trunk/build/daemon.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-07-23 10:17:15 -0400 (Wed, 23 Jul 2008)
New Revision: 1756
Modified:
trunk/build/daemon/buildall.bat
trunk/build/daemon/buildall.sh
Log:
Add rhel-httpd to the build jobs.
Modified: trunk/build/daemon/buildall.bat
===================================================================
--- trunk/build/daemon/buildall.bat 2008-07-22 11:52:29 UTC (rev 1755)
+++ trunk/build/daemon/buildall.bat 2008-07-23 14:17:15 UTC (rev 1756)
@@ -49,6 +49,12 @@
call build.bat sdk x86 jboss-native -ssl -cache
call build.bat sdk x64 jboss-native -ssl -cache
call build.bat sdk i64 jboss-native -ssl -cache
+
+REM build http using rhel repos
+call build.bat sdk x86 rhel-httpd -ssl -cache
+call build.bat sdk x64 rhel-httpd -ssl -cache
+call build.bat sdk i64 rhel-httpd -ssl -cache
+
REM Uncomment for building sight
REM call build.bat sdk x86 jboss-sight -cache
REM call build.bat sdk x64 jboss-sight -cache
Modified: trunk/build/daemon/buildall.sh
===================================================================
--- trunk/build/daemon/buildall.sh 2008-07-22 11:52:29 UTC (rev 1755)
+++ trunk/build/daemon/buildall.sh 2008-07-23 14:17:15 UTC (rev 1756)
@@ -48,8 +48,10 @@
(cd ../unix
if $build_ssl; then
./build.sh jboss-native -ssl -cache
+ ./build.sh rhel-httpd -ssl -cache
fi
./build.sh jboss-native -cache
+ ./build.sh rhel-httpd -cache
# Uncomment for building sight
# ./build.sh jboss-sight -cache
)
16 years, 5 months
JBoss Native SVN: r1755 - trunk/build/unix.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-07-22 07:52:29 -0400 (Tue, 22 Jul 2008)
New Revision: 1755
Modified:
trunk/build/unix/package.list
Log:
Upgrade openssl otherwise I get a core:
# C [libcrypto.so.0.9.8+0xcff10] PEM_read_bio_X509_AUX+0x0
Modified: trunk/build/unix/package.list
===================================================================
--- trunk/build/unix/package.list 2008-07-16 12:47:29 UTC (rev 1754)
+++ trunk/build/unix/package.list 2008-07-22 11:52:29 UTC (rev 1755)
@@ -4,7 +4,7 @@
jboss-native|2.0.2|TOMCAT_NATIVE_1_1_11|apr:v:1.2.9|apu:v:1.2.8|api:v:1.2.1|ssl:v:0.9.8e|zlib:v:1.2.3
jboss-native|2.0.3|TOMCAT_NATIVE_1_1_12|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1|ssl:v:0.9.8e|zlib:v:1.2.3
jboss-native|2.0.4|TOMCAT_NATIVE_1_1_13|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1|ssl:v:0.9.8e|zlib:v:1.2.3
-jboss-native|2.0.5-dev|TOMCAT_NATIVE_1_1_14|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1|ssl:v:0.9.8e|zlib:v:1.2.3
+jboss-native|2.0.5-dev|TOMCAT_NATIVE_1_1_14|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1|ssl:v:0.9.8h|zlib:v:1.2.3
# SIGHT
jboss-sight|1.0.0|trunk|apr:v:1.2.9|apu:v:1.2.8|api:v:1.2.1
jboss-sight|1.0.1|trunk|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1
16 years, 5 months
JBoss Native SVN: r1754 - trunk/mod_cluster/native/advertise.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-07-16 08:47:29 -0400 (Wed, 16 Jul 2008)
New Revision: 1754
Modified:
trunk/mod_cluster/native/advertise/mod_advertise.c
Log:
Make sure that any directive sets the conf for the VirtualHost
and prevent having directives in more than one VirtualHost.
Modified: trunk/mod_cluster/native/advertise/mod_advertise.c
===================================================================
--- trunk/mod_cluster/native/advertise/mod_advertise.c 2008-07-16 12:32:34 UTC (rev 1753)
+++ trunk/mod_cluster/native/advertise/mod_advertise.c 2008-07-16 12:47:29 UTC (rev 1754)
@@ -137,6 +137,12 @@
if (ma_advertise_srvs)
return "Duplicate ServerAdvertise directives are not allowed";
+ /* Virtual Host containing the directive */
+ if (ma_server_rec !=NULL && ma_server_rec != cmd->server)
+ return "All Advertise directives must be in the same VirtualHost";
+ if (ma_server_rec == NULL)
+ ma_server_rec = cmd->server;
+
if (strcasecmp(arg, "Off") == 0)
ma_advertise_mode = ma_advertise_off;
else if (strcasecmp(arg, "On") == 0)
@@ -157,7 +163,6 @@
!ma_advertise_srvp)
return "Invalid ServerAdvertise Address";
}
- ma_server_rec = cmd->server; /* Virtual Host containing the directive */
return NULL;
}
@@ -170,6 +175,11 @@
static const char *cmd_advertise_g(cmd_parms *cmd, void *dummy,
const char *arg)
{
+ if (ma_server_rec !=NULL && ma_server_rec != cmd->server)
+ return "All Advertise directives must be in the same VirtualHost";
+ if (ma_server_rec == NULL)
+ ma_server_rec = cmd->server;
+
if (ma_advertise_set)
return "Duplicate AdvertiseGroup directives are not allowed";
@@ -197,6 +207,11 @@
apr_time_t s, u = 0;
const char *p;
+ if (ma_server_rec !=NULL && ma_server_rec != cmd->server)
+ return "All Advertise directives must be in the same VirtualHost";
+ if (ma_server_rec == NULL)
+ ma_server_rec = cmd->server;
+
if (ma_advertise_freq != MA_DEFAULT_ADV_FREQ)
return "Duplicate AdvertiseFrequency directives are not allowed";
if ((p = ap_strchr_c(arg, '.')) || (p = ap_strchr_c(arg, ',')))
@@ -218,6 +233,11 @@
static const char *cmd_advertise_k(cmd_parms *cmd, void *dummy,
const char *arg)
{
+ if (ma_server_rec !=NULL && ma_server_rec != cmd->server)
+ return "All Advertise directives must be in the same VirtualHost";
+ if (ma_server_rec == NULL)
+ ma_server_rec = cmd->server;
+
if (ma_advertise_skey != NULL)
return "Duplicate AdvertiseSecurityKey directives are not allowed";
ma_advertise_skey = apr_pstrdup(cmd->pool, arg);
@@ -232,6 +252,11 @@
static const char *cmd_advertise_h(cmd_parms *cmd, void *dummy,
const char *arg)
{
+ if (ma_server_rec !=NULL && ma_server_rec != cmd->server)
+ return "All Advertise directives must be in the same VirtualHost";
+ if (ma_server_rec == NULL)
+ ma_server_rec = cmd->server;
+
if (ma_advertise_srvh != NULL)
return "Duplicate AdvertiseManagerUrl directives are not allowed";
ma_advertise_srvh = apr_pstrdup(cmd->pool, arg);
16 years, 5 months
JBoss Native SVN: r1753 - trunk/mod_cluster/native/advertise.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-07-16 08:32:34 -0400 (Wed, 16 Jul 2008)
New Revision: 1753
Modified:
trunk/mod_cluster/native/advertise/mod_advertise.c
Log:
Allow AdvertiseSecurityKey and AdvertiseManagerUrl in VirtualHost
but allow them only once.
Modified: trunk/mod_cluster/native/advertise/mod_advertise.c
===================================================================
--- trunk/mod_cluster/native/advertise/mod_advertise.c 2008-07-16 12:15:46 UTC (rev 1752)
+++ trunk/mod_cluster/native/advertise/mod_advertise.c 2008-07-16 12:32:34 UTC (rev 1753)
@@ -218,10 +218,8 @@
static const char *cmd_advertise_k(cmd_parms *cmd, void *dummy,
const char *arg)
{
- const char *errs = ap_check_cmd_context(cmd, GLOBAL_ONLY);
-
- if (errs != NULL)
- return errs;
+ if (ma_advertise_skey != NULL)
+ return "Duplicate AdvertiseSecurityKey directives are not allowed";
ma_advertise_skey = apr_pstrdup(cmd->pool, arg);
return NULL;
}
@@ -234,10 +232,8 @@
static const char *cmd_advertise_h(cmd_parms *cmd, void *dummy,
const char *arg)
{
- const char *errs = ap_check_cmd_context(cmd, GLOBAL_ONLY);
-
- if (errs != NULL)
- return errs;
+ if (ma_advertise_srvh != NULL)
+ return "Duplicate AdvertiseManagerUrl directives are not allowed";
ma_advertise_srvh = apr_pstrdup(cmd->pool, arg);
return NULL;
}
16 years, 5 months
JBoss Native SVN: r1752 - trunk/mod_cluster/native/advertise.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-07-16 08:15:46 -0400 (Wed, 16 Jul 2008)
New Revision: 1752
Modified:
trunk/mod_cluster/native/advertise/mod_advertise.c
Log:
Turn it on by default.
Modified: trunk/mod_cluster/native/advertise/mod_advertise.c
===================================================================
--- trunk/mod_cluster/native/advertise/mod_advertise.c 2008-07-16 12:02:55 UTC (rev 1751)
+++ trunk/mod_cluster/native/advertise/mod_advertise.c 2008-07-16 12:15:46 UTC (rev 1752)
@@ -78,7 +78,7 @@
/* Advertise is by default turned off */
static apr_port_t ma_advertise_port = MA_DEFAULT_ADVPORT;
static apr_port_t ma_advertise_srvp = 0;
-static ma_advertise_e ma_advertise_mode = ma_advertise_off;
+static ma_advertise_e ma_advertise_mode = ma_advertise_on;
static apr_interval_time_t ma_advertise_freq = MA_DEFAULT_ADV_FREQ;
/* Advertise sockets */
16 years, 5 months
JBoss Native SVN: r1751 - trunk/mod_cluster/native/advertise.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-07-16 08:02:55 -0400 (Wed, 16 Jul 2008)
New Revision: 1751
Modified:
trunk/mod_cluster/native/advertise/mod_advertise.c
trunk/mod_cluster/native/advertise/mod_advertise.h
Log:
Use default values like in ClusterListener.
Modified: trunk/mod_cluster/native/advertise/mod_advertise.c
===================================================================
--- trunk/mod_cluster/native/advertise/mod_advertise.c 2008-07-16 09:40:04 UTC (rev 1750)
+++ trunk/mod_cluster/native/advertise/mod_advertise.c 2008-07-16 12:02:55 UTC (rev 1751)
@@ -61,7 +61,7 @@
static int ma_advertise_set = 0;
static int ma_advertise_run = 0;
static int ma_advertise_stat = 0;
-static char *ma_advertise_adrs = NULL;
+static char *ma_advertise_adrs = MA_DEFAULT_GROUP;
static char *ma_advertise_adsi = NULL;
static char *ma_advertise_srvm = NULL;
static char *ma_advertise_srvh = NULL;
@@ -134,7 +134,7 @@
const char *arg, const char *opt)
{
- if (ma_advertise_adrs)
+ if (ma_advertise_srvs)
return "Duplicate ServerAdvertise directives are not allowed";
if (strcasecmp(arg, "Off") == 0)
@@ -500,7 +500,7 @@
ma_advertise_srvh = magd->srvid;
/* Check if we have advertise set */
if (ma_advertise_mode != ma_advertise_off &&
- ma_advertise_set && ma_advertise_adrs) {
+ ma_advertise_adrs) {
rv = ma_group_join(ma_advertise_adrs, ma_advertise_port, pconf);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
Modified: trunk/mod_cluster/native/advertise/mod_advertise.h
===================================================================
--- trunk/mod_cluster/native/advertise/mod_advertise.h 2008-07-16 09:40:04 UTC (rev 1750)
+++ trunk/mod_cluster/native/advertise/mod_advertise.h 2008-07-16 12:02:55 UTC (rev 1751)
@@ -90,6 +90,7 @@
#define MA_BSIZE 4096
#define MA_SSIZE 1024
#define MA_DEFAULT_ADVPORT 23364
+#define MA_DEFAULT_GROUP "224.0.1.105"
#define MA_TM_RESOLUTION APR_TIME_C(100000)
#define MA_DEFAULT_ADV_FREQ apr_time_from_sec(10)
#define MA_TM_MAINTAIN_STEP 10
16 years, 5 months
JBoss Native SVN: r1750 - trunk/mod_cluster/native/mod_manager.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-07-16 05:40:04 -0400 (Wed, 16 Jul 2008)
New Revision: 1750
Modified:
trunk/mod_cluster/native/mod_manager/mod_manager.c
Log:
Arrange default value for MemManagerFile
Modified: trunk/mod_cluster/native/mod_manager/mod_manager.c
===================================================================
--- trunk/mod_cluster/native/mod_manager/mod_manager.c 2008-07-11 15:01:38 UTC (rev 1749)
+++ trunk/mod_cluster/native/mod_manager/mod_manager.c 2008-07-16 09:40:04 UTC (rev 1750)
@@ -277,10 +277,10 @@
host = apr_pstrcat(ptemp, mconf->basefilename, ".host", NULL);
balancer = apr_pstrcat(ptemp, mconf->basefilename, ".balancer", NULL);
} else {
- node = "manager.node";
- context = "manager.context";
- host = "manager.host";
- host = "manager.balancer";
+ node = ap_server_root_relative(ptemp, "logs/manager.node");
+ context = ap_server_root_relative(ptemp, "logs/manager.context");
+ host = ap_server_root_relative(ptemp, "logs/manager.host");
+ balancer = ap_server_root_relative(ptemp, "logs/manager.balancer");
}
/* Get a provider to handle the shared memory */
@@ -1187,10 +1187,10 @@
host = apr_pstrcat(p, mconf->basefilename, ".host", NULL);
balancer = apr_pstrcat(p, mconf->basefilename, ".balancer", NULL);
} else {
- node = "manager.node";
- context = "manager.context";
- host = "manager.host";
- balancer = "manager.balancer";
+ node = ap_server_root_relative(p, "logs/manager.node");
+ context = ap_server_root_relative(p, "logs/manager.context");
+ host = ap_server_root_relative(p, "logs/manager.host");
+ balancer = ap_server_root_relative(p, "logs/manager.balancer");
}
nodestatsmem = get_mem_node(node, &mconf->maxnode, p, storage);
@@ -1243,6 +1243,8 @@
{
mod_manager_config *mconf = ap_get_module_config(cmd->server->module_config, &manager_module);
mconf->basefilename = apr_pstrdup(cmd->pool, word);
+ if (apr_dir_make_recursive(mconf->basefilename, APR_UREAD | APR_UWRITE | APR_UEXECUTE, cmd->pool) != APR_SUCCESS)
+ return "Can't create directory corresponding to MemManagerFile";
return NULL;
}
static const char *cmd_manager_balancername(cmd_parms *cmd, void *mconfig, const char *word)
16 years, 5 months
JBoss Native SVN: r1749 - trunk/mod_cluster/native/mod_proxy_cluster.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-07-11 11:01:38 -0400 (Fri, 11 Jul 2008)
New Revision: 1749
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Arrange locking.
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-07-11 15:00:44 UTC (rev 1748)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-07-11 15:01:38 UTC (rev 1749)
@@ -278,7 +278,7 @@
i = helper->count_active;
#endif
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, server,
- "remove_workers_node %d", i);
+ "remove_workers_node %d %s", i, node->mess.JVMRoute);
if (i == 0) {
/* No connection in use: clean the worker */
proxy_balancer *balancer;
@@ -322,13 +322,14 @@
int notok = 0;
/* Check if we have to do something */
+ apr_thread_mutex_lock(lock);
last = node_storage->worker_nodes_need_update(server, pool);
/* nodes_need_update will return 1 if last_updated is zero: first time we are called */
if (last == 0) {
+ apr_thread_mutex_unlock(lock);
return;
}
- apr_thread_mutex_lock(lock);
/* read the ident of the nodes */
id = apr_pcalloc(pool, sizeof(int) * node_storage->get_max_size_node());
@@ -1124,7 +1125,11 @@
apr_status_t rv;
apr_thread_t *wdt;
- apr_thread_mutex_create(&lock, APR_THREAD_MUTEX_DEFAULT, p);
+ rv = apr_thread_mutex_create(&lock, APR_THREAD_MUTEX_DEFAULT, p);
+ if (rv != APR_SUCCESS) {
+ ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, s,
+ "proxy_cluster_child_init: apr_thread_mutex_create failed");
+ }
rv = apr_thread_create(&wdt, NULL, proxy_cluster_watchdog_func, s, p);
if (rv != APR_SUCCESS) {
16 years, 5 months
JBoss Native SVN: r1748 - trunk/mod_cluster/native/mod_slotmem.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-07-11 11:00:44 -0400 (Fri, 11 Jul 2008)
New Revision: 1748
Modified:
trunk/mod_cluster/native/mod_slotmem/mod_sharedmem.c
trunk/mod_cluster/native/mod_slotmem/sharedmem_util.c
Log:
Add a lock for insert/remove.
Modified: trunk/mod_cluster/native/mod_slotmem/mod_sharedmem.c
===================================================================
--- trunk/mod_cluster/native/mod_slotmem/mod_sharedmem.c 2008-07-11 13:00:50 UTC (rev 1747)
+++ trunk/mod_cluster/native/mod_slotmem/mod_sharedmem.c 2008-07-11 15:00:44 UTC (rev 1748)
@@ -79,12 +79,22 @@
return OK;
}
+/*
+ * Create the mutex of the insert/remove logic
+ */
+static void child_init(apr_pool_t *p, server_rec *s)
+{
+ sharedmem_initialize_child(p);
+}
+
static void ap_sharedmem_register_hook(apr_pool_t *p)
{
const slotmem_storage_method *storage = mem_getstorage(NULL, "");
ap_register_provider(p, SLOTMEM_STORAGE, "shared", "0", storage);
ap_hook_post_config(initialize_cleanup, NULL, NULL, APR_HOOK_LAST);
ap_hook_pre_config(pre_config, NULL, NULL, APR_HOOK_MIDDLE);
+
+ ap_hook_child_init(child_init, NULL, NULL, APR_HOOK_MIDDLE);
}
module AP_MODULE_DECLARE_DATA sharedmem_module = {
Modified: trunk/mod_cluster/native/mod_slotmem/sharedmem_util.c
===================================================================
--- trunk/mod_cluster/native/mod_slotmem/sharedmem_util.c 2008-07-11 13:00:50 UTC (rev 1747)
+++ trunk/mod_cluster/native/mod_slotmem/sharedmem_util.c 2008-07-11 15:00:44 UTC (rev 1748)
@@ -77,6 +77,7 @@
/* global pool and list of slotmem we are handling */
static struct ap_slotmem *globallistmem = NULL;
static apr_pool_t *globalpool = NULL;
+static apr_thread_mutex_t *globalmutex_lock = NULL;
apr_status_t unixd_set_shm_perms(const char *fname)
{
@@ -436,12 +437,22 @@
*mem = ptr;
return APR_SUCCESS;
}
+
+/* Lock the file lock (between processes) and then the mutex */
static apr_status_t ap_slotmem_lock(ap_slotmem_t *s)
{
- return(apr_file_lock(s->global_lock, APR_FLOCK_EXCLUSIVE));
+ apr_status_t rv;
+ rv = apr_file_lock(s->global_lock, APR_FLOCK_EXCLUSIVE);
+ if (rv != APR_SUCCESS)
+ return rv;
+ rv = apr_thread_mutex_lock(globalmutex_lock);
+ if (rv != APR_SUCCESS)
+ apr_file_unlock(s->global_lock);
+ return rv;
}
static apr_status_t ap_slotmem_unlock(ap_slotmem_t *s)
{
+ apr_thread_mutex_unlock(globalmutex_lock);
return(apr_file_unlock(s->global_lock));
}
static apr_status_t ap_slotmem_alloc(ap_slotmem_t *score, int *item_id, void**mem)
@@ -530,3 +541,8 @@
{
apr_pool_cleanup_register(p, &globallistmem, cleanup_slotmem, apr_pool_cleanup_null);
}
+/* Create the mutex for insert/remove logic */
+apr_status_t sharedmem_initialize_child(apr_pool_t *p)
+{
+ return (apr_thread_mutex_create(&globalmutex_lock, APR_THREAD_MUTEX_DEFAULT, globalpool));
+}
16 years, 5 months