JBoss Native SVN: r2511 - in trunk/mod_cluster/native: mod_proxy_cluster and 1 other directory.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-07-27 06:09:18 -0400 (Mon, 27 Jul 2009)
New Revision: 2511
Modified:
trunk/mod_cluster/native/include/domain.h
trunk/mod_cluster/native/include/node.h
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Arrange prototyping.
Modified: trunk/mod_cluster/native/include/domain.h
===================================================================
--- trunk/mod_cluster/native/include/domain.h 2009-07-27 07:28:26 UTC (rev 2510)
+++ trunk/mod_cluster/native/include/domain.h 2009-07-27 10:09:18 UTC (rev 2511)
@@ -91,6 +91,15 @@
*/
apr_status_t remove_domain(mem_t *s, domaininfo_t *domain);
+/**
+ * find a domain record from the shared table using JVMRoute and balancer
+ * @param pointer to the shared table.
+ * @param domain address where the node is located in the shared table.
+ * @param route JVMRoute to search
+ * @return APR_SUCCESS if all went well
+ */
+apr_status_t find_domain(mem_t *s, domaininfo_t **domain, const char *route, const char *balancer);
+
/*
* get the ids for the used (not free) domains in the table
* @param pointer to the shared table.
Modified: trunk/mod_cluster/native/include/node.h
===================================================================
--- trunk/mod_cluster/native/include/node.h 2009-07-27 07:28:26 UTC (rev 2510)
+++ trunk/mod_cluster/native/include/node.h 2009-07-27 10:09:18 UTC (rev 2511)
@@ -120,6 +120,15 @@
*/
apr_status_t remove_node(mem_t *s, nodeinfo_t *node);
+/**
+ * find a node record from the shared table using JVMRoute
+ * @param pointer to the shared table.
+ * @param node address where the node is located in the shared table.
+ * @param route JVMRoute to search
+ * @return APR_SUCCESS if all went well
+ */
+apr_status_t find_node(mem_t *s, nodeinfo_t **node, const char *route);
+
/*
* get the ids for the used (not free) nodes in the table
* @param pointer to the shared table.
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2009-07-27 07:28:26 UTC (rev 2510)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2009-07-27 10:09:18 UTC (rev 2511)
@@ -1507,13 +1507,13 @@
}
/* Given the route find the corresponding domain (if there is a domain) */
-static apr_status_t find_domain(request_rec *r, char **domain, char *route, const char *balancer)
+static apr_status_t find_nodedomain(request_rec *r, char **domain, char *route, const char *balancer)
{
nodeinfo_t *ou;
domaininfo_t *dom;
#if HAVE_CLUSTER_EX_DEBUG
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "find_domain: finding node for %s: %s", route, balancer);
+ "find_nodedomain: finding node for %s: %s", route, balancer);
#endif
if (node_storage->find_node(&ou, route) == APR_SUCCESS) {
if (!strcmp(balancer, ou->mess.balancer)) {
@@ -1526,7 +1526,7 @@
#if HAVE_CLUSTER_EX_DEBUG
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "find_domain: finding domain for %s: %s", route, balancer);
+ "find_nodedomain: finding domain for %s: %s", route, balancer);
#endif
/* We can't find the node, because it was removed... */
if (domain_storage->find_domain(&dom, route, balancer ) == APR_SUCCESS) {
@@ -1568,7 +1568,7 @@
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
"cluster: Found route %s", route);
#endif
- if (find_domain(r, &domain, route, &balancer->name[11]) == APR_SUCCESS) {
+ if (find_nodedomain(r, &domain, route, &balancer->name[11]) == APR_SUCCESS) {
#if HAVE_CLUSTER_EX_DEBUG
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
"cluster: Found balancer %s for %s", &balancer->name[11], route);
15 years, 5 months
JBoss Native SVN: r2510 - trunk/mod_cluster/native/include.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-07-27 03:28:26 -0400 (Mon, 27 Jul 2009)
New Revision: 2510
Modified:
trunk/mod_cluster/native/include/balancer.h
trunk/mod_cluster/native/include/context.h
trunk/mod_cluster/native/include/domain.h
trunk/mod_cluster/native/include/host.h
trunk/mod_cluster/native/include/sessionid.h
Log:
Use apr_time_t.
Modified: trunk/mod_cluster/native/include/balancer.h
===================================================================
--- trunk/mod_cluster/native/include/balancer.h 2009-07-27 07:16:29 UTC (rev 2509)
+++ trunk/mod_cluster/native/include/balancer.h 2009-07-27 07:28:26 UTC (rev 2510)
@@ -57,7 +57,7 @@
int Timeout;
int Maxattempts;
- unsigned long updatetime; /* time of last received message */
+ apr_time_t updatetime; /* time of last received message */
int id; /* id in table */
};
typedef struct balancerinfo balancerinfo_t;
Modified: trunk/mod_cluster/native/include/context.h
===================================================================
--- trunk/mod_cluster/native/include/context.h 2009-07-27 07:16:29 UTC (rev 2509)
+++ trunk/mod_cluster/native/include/context.h 2009-07-27 07:28:26 UTC (rev 2510)
@@ -59,7 +59,7 @@
int node; /* id of the correspond node in nodes table */
int status; /* status: ENABLED/DISABLED/STOPPED */
- unsigned long updatetime; /* time of last received message */
+ apr_time_t updatetime; /* time of last received message */
int id; /* id in table */
};
typedef struct contextinfo contextinfo_t;
Modified: trunk/mod_cluster/native/include/domain.h
===================================================================
--- trunk/mod_cluster/native/include/domain.h 2009-07-27 07:16:29 UTC (rev 2509)
+++ trunk/mod_cluster/native/include/domain.h 2009-07-27 07:28:26 UTC (rev 2510)
@@ -52,7 +52,7 @@
char JVMRoute[JVMROUTESZ]; /* corresponding node */
char balancer[BALANCERSZ]; /* name of the balancer */
- unsigned long updatetime; /* time of last received message */
+ apr_time_t updatetime; /* time of last received message */
int id; /* id in table */
};
typedef struct domaininfo domaininfo_t;
Modified: trunk/mod_cluster/native/include/host.h
===================================================================
--- trunk/mod_cluster/native/include/host.h 2009-07-27 07:16:29 UTC (rev 2509)
+++ trunk/mod_cluster/native/include/host.h 2009-07-27 07:28:26 UTC (rev 2510)
@@ -52,7 +52,7 @@
int vhost; /* id of the correspond virtual host */
int node; /* id of the node containing the virtual host */
- unsigned long updatetime; /* time of last received message */
+ apr_time_t updatetime; /* time of last received message */
int id; /* id in table */
};
typedef struct hostinfo hostinfo_t;
Modified: trunk/mod_cluster/native/include/sessionid.h
===================================================================
--- trunk/mod_cluster/native/include/sessionid.h 2009-07-27 07:16:29 UTC (rev 2509)
+++ trunk/mod_cluster/native/include/sessionid.h 2009-07-27 07:28:26 UTC (rev 2510)
@@ -51,7 +51,7 @@
char sessionid[SESSIONIDSZ]; /* Sessionid value */
char JVMRoute[JVMROUTESZ]; /* corresponding node */
- unsigned long updatetime; /* time of last received message */
+ apr_time_t updatetime; /* time of last received message */
int id; /* id in table */
};
typedef struct sessionidinfo sessionidinfo_t;
15 years, 5 months
JBoss Native SVN: r2509 - trunk/httpd/httpd-2.2/modules/mod_manager.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-07-27 03:16:29 -0400 (Mon, 27 Jul 2009)
New Revision: 2509
Modified:
trunk/httpd/httpd-2.2/modules/mod_manager/NMAKEmanager
trunk/httpd/httpd-2.2/modules/mod_manager/config5.m4
Log:
Add missing domain object.
Modified: trunk/httpd/httpd-2.2/modules/mod_manager/NMAKEmanager
===================================================================
--- trunk/httpd/httpd-2.2/modules/mod_manager/NMAKEmanager 2009-07-27 07:12:32 UTC (rev 2508)
+++ trunk/httpd/httpd-2.2/modules/mod_manager/NMAKEmanager 2009-07-27 07:16:29 UTC (rev 2509)
@@ -52,6 +52,7 @@
$(WORKDIR)\host.obj \
$(WORKDIR)\node.obj \
$(WORKDIR)\sessionid.obj \
+ $(WORKDIR)\domain.obj \
$(WORKDIR)\mod_manager.obj
{$(SRCDIR)}.c{$(WORKDIR)}.obj:
Modified: trunk/httpd/httpd-2.2/modules/mod_manager/config5.m4
===================================================================
--- trunk/httpd/httpd-2.2/modules/mod_manager/config5.m4 2009-07-27 07:12:32 UTC (rev 2508)
+++ trunk/httpd/httpd-2.2/modules/mod_manager/config5.m4 2009-07-27 07:16:29 UTC (rev 2509)
@@ -2,7 +2,7 @@
APACHE_MODPATH_INIT(mod_manager)
-manager_objects="mod_manager.lo balancer.lo context.lo host.lo node.lo sessionid.lo"
+manager_objects="mod_manager.lo balancer.lo context.lo host.lo node.lo sessionid.lo domain.lo"
APACHE_MODULE(manager, Manager for mod_cluster, $manager_objects, , no)
15 years, 5 months
JBoss Native SVN: r2508 - trunk/mod_cluster/native/mod_manager.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-07-27 03:12:32 -0400 (Mon, 27 Jul 2009)
New Revision: 2508
Modified:
trunk/mod_cluster/native/mod_manager/mod_manager.c
Log:
Oops that was bad ;-(
Modified: trunk/mod_cluster/native/mod_manager/mod_manager.c
===================================================================
--- trunk/mod_cluster/native/mod_manager/mod_manager.c 2009-07-24 13:55:00 UTC (rev 2507)
+++ trunk/mod_cluster/native/mod_manager/mod_manager.c 2009-07-27 07:12:32 UTC (rev 2508)
@@ -580,7 +580,7 @@
static void remove_host_context(request_rec *r, int node)
{
/* for read the hosts */
- int i,j;
+ int i;
int size = get_max_size_host(hoststatsmem);
int *id = apr_palloc(r->pool, sizeof(int) * size);
int sizecontext = get_max_size_context(contextstatsmem);
@@ -593,8 +593,6 @@
size = get_ids_used_host(hoststatsmem, id);
for (i=0; i<size; i++) {
hostinfo_t *ou;
- int sizecontext;
- int *idcontext;
if (get_host(hoststatsmem, &ou, id[i]) != APR_SUCCESS)
continue;
15 years, 5 months
JBoss Native SVN: r2507 - in trunk/mod_cluster/native: mod_manager and 1 other directories.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-07-24 09:55:00 -0400 (Fri, 24 Jul 2009)
New Revision: 2507
Added:
trunk/mod_cluster/native/include/domain.h
trunk/mod_cluster/native/mod_manager/domain.c
Modified:
trunk/mod_cluster/native/mod_manager/Makefile.in
trunk/mod_cluster/native/mod_manager/mod_manager.c
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Add shared area with removed node for the domain handling (fix for MODCLUSTER-82).
Added: trunk/mod_cluster/native/include/domain.h
===================================================================
--- trunk/mod_cluster/native/include/domain.h (rev 0)
+++ trunk/mod_cluster/native/include/domain.h 2009-07-24 13:55:00 UTC (rev 2507)
@@ -0,0 +1,161 @@
+/*
+ * mod_cluster
+ *
+ * Copyright(c) 2009 Red Hat Middleware, LLC,
+ * and individual contributors as indicated by the @authors tag.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library in the file COPYING.LIB;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *
+ * @author Jean-Frederic Clere
+ * @version $Revision$
+ */
+
+#ifndef DOMAIN_H
+#define DOMAIN_H
+
+/**
+ * @file domain.h
+ * @brief domain description Storage Module for Apache
+ *
+ * @defgroup MEM domain
+ * @ingroup APACHE_MODS
+ * @{
+ */
+
+#define DOMAINEXE ".domain"
+
+#ifndef MEM_T
+typedef struct mem mem_t;
+#define MEM_T
+#endif
+
+#include "mod_clustersize.h"
+
+/* status of the domain as read/store in httpd. */
+struct domaininfo {
+ char domain[DOMAINNDSZ]; /* domain value */
+ char JVMRoute[JVMROUTESZ]; /* corresponding node */
+ char balancer[BALANCERSZ]; /* name of the balancer */
+
+ unsigned long updatetime; /* time of last received message */
+ int id; /* id in table */
+};
+typedef struct domaininfo domaininfo_t;
+
+
+/**
+ * Insert(alloc) and update a domain record in the shared table
+ * @param pointer to the shared table.
+ * @param domain domain to store in the shared table.
+ * @return APR_SUCCESS if all went well
+ *
+ */
+apr_status_t insert_update_domain(mem_t *s, domaininfo_t *domain);
+
+/**
+ * read a domain record from the shared table
+ * @param pointer to the shared table.
+ * @param domain domain to read from the shared table.
+ * @return address of the read domain or NULL if error.
+ */
+domaininfo_t * read_domain(mem_t *s, domaininfo_t *domain);
+
+/**
+ * get a domain record from the shared table
+ * @param pointer to the shared table.
+ * @param domain address of the domain read from the shared table.
+ * @return APR_SUCCESS if all went well
+ */
+apr_status_t get_domain(mem_t *s, domaininfo_t **domain, int ids);
+
+/**
+ * remove(free) a domain record from the shared table
+ * @param pointer to the shared table.
+ * @param domain domain to remove from the shared table.
+ * @return APR_SUCCESS if all went well
+ */
+apr_status_t remove_domain(mem_t *s, domaininfo_t *domain);
+
+/*
+ * get the ids for the used (not free) domains in the table
+ * @param pointer to the shared table.
+ * @param ids array of int to store the used id (must be big enough).
+ * @return number of domain existing or -1 if error.
+ */
+int get_ids_used_domain(mem_t *s, int *ids);
+
+/*
+ * get the size of the table (max size).
+ * @param pointer to the shared table.
+ * @return size of the existing table or -1 if error.
+ */
+int get_max_size_domain(mem_t *s);
+
+/**
+ * attach to the shared domain table
+ * @param name of an existing shared table.
+ * @param address to store the size of the shared table.
+ * @param p pool to use for allocations.
+ * @return address of struct used to access the table.
+ */
+mem_t * get_mem_domain(char *string, int *num, apr_pool_t *p, slotmem_storage_method *storage);
+/**
+ * create a shared domain table
+ * @param name to use to create the table.
+ * @param size of the shared table.
+ * @param persist tell if the slotmem element are persistent.
+ * @param p pool to use for allocations.
+ * @return address of struct used to access the table.
+ */
+mem_t * create_mem_domain(char *string, int *num, int persist, apr_pool_t *p, slotmem_storage_method *storage);
+
+/**
+ * provider for the mod_proxy_cluster or mod_jk modules.
+ */
+struct domain_storage_method {
+/**
+ * the domain corresponding to the ident
+ * @param ids ident of the domain to read.
+ * @param domain address of pointer to return the domain.
+ * @return APR_SUCCESS if all went well
+ */
+apr_status_t (* read_domain)(int ids, domaininfo_t **domain);
+/**
+ * read the list of ident of used domains.
+ * @param ids address to store the idents.
+ * @return APR_SUCCESS if all went well
+ */
+int (* get_ids_used_domain)(int *ids);
+/**
+ * read the max number of domains in the shared table
+ */
+int (*get_max_size_domain)();
+/*
+ * Remove the domain from shared memory (free the slotmem)
+ */
+apr_status_t (*remove_domain)(domaininfo_t *domain);
+/*
+ * Insert a new domain or update existing one.
+ */
+apr_status_t (*insert_update_domain)(domaininfo_t *domain);
+/*
+ * Find the domain using the JVMRoute and balancer information
+ */
+apr_status_t (*find_domain)(domaininfo_t **node, const char *route, const char *balancer);
+};
+#endif /*DOMAIN_H*/
Modified: trunk/mod_cluster/native/mod_manager/Makefile.in
===================================================================
--- trunk/mod_cluster/native/mod_manager/Makefile.in 2009-07-24 13:34:39 UTC (rev 2506)
+++ trunk/mod_cluster/native/mod_manager/Makefile.in 2009-07-24 13:55:00 UTC (rev 2507)
@@ -15,8 +15,8 @@
mod_manager.so: mod_manager.la
$(top_builddir)/build/instdso.sh SH_LIBTOOL='$(LIBTOOL)' mod_manager.la `pwd`
-mod_manager.la: mod_manager.slo node.slo context.slo host.slo balancer.slo sessionid.slo
- $(SH_LINK) -rpath $(libexecdir) -module -avoid-version mod_manager.lo node.lo context.lo host.lo balancer.lo sessionid.lo
+mod_manager.la: mod_manager.slo node.slo context.slo host.slo balancer.slo sessionid.slo domain.slo
+ $(SH_LINK) -rpath $(libexecdir) -module -avoid-version mod_manager.lo node.lo context.lo host.lo balancer.lo sessionid.lo domain.lo
clean:
rm -f *.o *.lo *.slo *.so
Added: trunk/mod_cluster/native/mod_manager/domain.c
===================================================================
--- trunk/mod_cluster/native/mod_manager/domain.c (rev 0)
+++ trunk/mod_cluster/native/mod_manager/domain.c 2009-07-24 13:55:00 UTC (rev 2507)
@@ -0,0 +1,246 @@
+/*
+ * mod_cluster
+ *
+ * Copyright(c) 2009 Red Hat Middleware, LLC,
+ * and individual contributors as indicated by the @authors tag.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library in the file COPYING.LIB;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *
+ * @author Jean-Frederic Clere
+ * @version $Revision$
+ */
+
+/**
+ * @file domain.c
+ * @brief domain description Storage Module for Apache
+ *
+ * @defgroup MEM domains
+ * @ingroup APACHE_MODS
+ * @{
+ */
+
+#include "apr.h"
+#include "apr_strings.h"
+#include "apr_pools.h"
+#include "apr_time.h"
+
+#include "slotmem.h"
+#include "domain.h"
+
+struct mem {
+ ap_slotmem_t *slotmem;
+ const slotmem_storage_method *storage;
+ int num;
+ apr_pool_t *p;
+};
+
+static mem_t * create_attach_mem_domain(char *string, int *num, int type, apr_pool_t *p, slotmem_storage_method *storage) {
+ mem_t *ptr;
+ const char *storename;
+ apr_status_t rv;
+
+ ptr = apr_pcalloc(p, sizeof(mem_t));
+ if (!ptr) {
+ return NULL;
+ }
+ ptr->storage = storage;
+ storename = apr_pstrcat(p, string, DOMAINEXE, NULL);
+ if (type)
+ rv = ptr->storage->ap_slotmem_create(&ptr->slotmem, storename, sizeof(domaininfo_t), *num, type, p);
+ else {
+ apr_size_t size = sizeof(domaininfo_t);
+ rv = ptr->storage->ap_slotmem_attach(&ptr->slotmem, storename, &size, num, p);
+ }
+ if (rv != APR_SUCCESS) {
+ return NULL;
+ }
+ ptr->num = *num;
+ ptr->p = p;
+ return ptr;
+}
+/**
+ * Insert(alloc) and update a domain record in the shared table
+ * @param pointer to the shared table.
+ * @param domain domain to store in the shared table.
+ * @return APR_SUCCESS if all went well
+ *
+ */
+static apr_status_t insert_update(void* mem, void **data, int id, apr_pool_t *pool)
+{
+ domaininfo_t *in = (domaininfo_t *)*data;
+ domaininfo_t *ou = (domaininfo_t *)mem;
+ if (strcmp(in->JVMRoute, ou->JVMRoute) == 0 && strcmp(in->balancer, ou->balancer) == 0) {
+ memcpy(ou, in, sizeof(domaininfo_t));
+ ou->id = id;
+ ou->updatetime = apr_time_sec(apr_time_now());
+ *data = ou;
+ return APR_SUCCESS;
+ }
+ return APR_NOTFOUND;
+}
+apr_status_t insert_update_domain(mem_t *s, domaininfo_t *domain)
+{
+ apr_status_t rv;
+ domaininfo_t *ou;
+ int ident;
+
+ domain->id = 0;
+ rv = s->storage->ap_slotmem_do(s->slotmem, insert_update, &domain, s->p);
+ if (domain->id != 0 && rv == APR_SUCCESS) {
+ return APR_SUCCESS; /* updated */
+ }
+
+ /* we have to insert it */
+ rv = s->storage->ap_slotmem_alloc(s->slotmem, &ident, (void **) &ou);
+ if (rv != APR_SUCCESS) {
+ return rv;
+ }
+ memcpy(ou, domain, sizeof(domaininfo_t));
+ ou->id = ident;
+ ou->updatetime = apr_time_sec(apr_time_now());
+
+ return APR_SUCCESS;
+}
+
+/**
+ * read a domain record from the shared table
+ * @param pointer to the shared table.
+ * @param domain domain to read from the shared table.
+ * @return address of the read domain or NULL if error.
+ */
+static apr_status_t loc_read_domain(void* mem, void **data, int id, apr_pool_t *pool) {
+ domaininfo_t *in = (domaininfo_t *)*data;
+ domaininfo_t *ou = (domaininfo_t *)mem;
+
+ if (strcmp(in->JVMRoute, ou->JVMRoute) == 0 && strcmp(in->balancer, ou->balancer) == 0) {
+ *data = ou;
+ return APR_SUCCESS;
+ }
+ return APR_NOTFOUND;
+}
+domaininfo_t * read_domain(mem_t *s, domaininfo_t *domain)
+{
+ apr_status_t rv;
+ domaininfo_t *ou = domain;
+
+ if (domain->id)
+ rv = s->storage->ap_slotmem_mem(s->slotmem, domain->id, (void **) &ou);
+ else {
+ rv = s->storage->ap_slotmem_do(s->slotmem, loc_read_domain, &ou, s->p);
+ }
+ if (rv == APR_SUCCESS)
+ return ou;
+ return NULL;
+}
+/**
+ * get a domain record from the shared table
+ * @param pointer to the shared table.
+ * @param domain address where the domain is locate in the shared table.
+ * @param ids in the domain table.
+ * @return APR_SUCCESS if all went well
+ */
+apr_status_t get_domain(mem_t *s, domaininfo_t **domain, int ids)
+{
+ return(s->storage->ap_slotmem_mem(s->slotmem, ids, (void **) domain));
+}
+
+/**
+ * remove(free) a domain record from the shared table
+ * @param pointer to the shared table.
+ * @param domain domain to remove from the shared table.
+ * @return APR_SUCCESS if all went well
+ */
+apr_status_t remove_domain(mem_t *s, domaininfo_t *domain)
+{
+ apr_status_t rv;
+ domaininfo_t *ou = domain;
+ if (domain->id)
+ s->storage->ap_slotmem_free(s->slotmem, domain->id, domain);
+ else {
+ /* XXX: for the moment January 2007 ap_slotmem_free only uses ident to remove */
+ rv = s->storage->ap_slotmem_do(s->slotmem, loc_read_domain, &ou, s->p);
+ if (rv == APR_SUCCESS)
+ rv = s->storage->ap_slotmem_free(s->slotmem, ou->id, domain);
+ }
+ return rv;
+}
+
+/**
+ * find a domain record from the shared table using JVMRoute and balancer
+ * @param pointer to the shared table.
+ * @param domain address where the node is located in the shared table.
+ * @param route JVMRoute to search
+ * @return APR_SUCCESS if all went well
+ */
+apr_status_t find_domain(mem_t *s, domaininfo_t **domain, const char *route, const char *balancer)
+{
+ domaininfo_t ou;
+ apr_status_t rv;
+
+ strcpy(ou.JVMRoute, route);
+ strcpy(ou.balancer, balancer);
+ *domain = &ou;
+ rv = s->storage->ap_slotmem_do(s->slotmem, loc_read_domain, domain, s->p);
+ return rv;
+}
+
+
+/*
+ * get the ids for the used (not free) domains in the table
+ * @param pointer to the shared table.
+ * @param ids array of int to store the used id (must be big enough).
+ * @return number of domain existing or -1 if error.
+ */
+int get_ids_used_domain(mem_t *s, int *ids)
+{
+ return (s->storage->ap_slotmem_get_used(s->slotmem, ids));
+}
+
+/*
+ * read the size of the table.
+ * @param pointer to the shared table.
+ * @return number of domain existing or -1 if error.
+ */
+int get_max_size_domain(mem_t *s)
+{
+ return (s->storage->ap_slotmem_get_max_size(s->slotmem));
+}
+
+/**
+ * attach to the shared domain table
+ * @param name of an existing shared table.
+ * @param address to store the size of the shared table.
+ * @param p pool to use for allocations.
+ * @return address of struct used to access the table.
+ */
+mem_t * get_mem_domain(char *string, int *num, apr_pool_t *p, slotmem_storage_method *storage)
+{
+ return(create_attach_mem_domain(string, num, 0, p, storage));
+}
+/**
+ * create a shared domain table
+ * @param name to use to create the table.
+ * @param size of the shared table.
+ * @param persist tell if the slotmem element are persistent.
+ * @param p pool to use for allocations.
+ * @return address of struct used to access the table.
+ */
+mem_t * create_mem_domain(char *string, int *num, int persist, apr_pool_t *p, slotmem_storage_method *storage)
+{
+ return(create_attach_mem_domain(string, num, CREATE_SLOTMEM|persist, p, storage));
+}
Modified: trunk/mod_cluster/native/mod_manager/mod_manager.c
===================================================================
--- trunk/mod_cluster/native/mod_manager/mod_manager.c 2009-07-24 13:34:39 UTC (rev 2506)
+++ trunk/mod_cluster/native/mod_manager/mod_manager.c 2009-07-24 13:55:00 UTC (rev 2507)
@@ -50,6 +50,7 @@
#include "context.h"
#include "balancer.h"
#include "sessionid.h"
+#include "domain.h"
#define DEFMAXCONTEXT 100
#define DEFMAXNODE 20
@@ -94,12 +95,16 @@
#define RANGENODE 1
#define RANGEDOMAIN 2
+/* define HAVE_CLUSTER_EX_DEBUG to have extented debug in mod_cluster */
+#define HAVE_CLUSTER_EX_DEBUG 0
+
/* shared memory */
mem_t *contextstatsmem = NULL;
mem_t *nodestatsmem = NULL;
mem_t *hoststatsmem = NULL;
mem_t *balancerstatsmem = NULL;
mem_t *sessionidstatsmem = NULL;
+mem_t *domainstatsmem = NULL;
slotmem_storage_method *storage = NULL;
balancer_method *balancerhandler = NULL;
@@ -301,6 +306,43 @@
loc_insert_update_sessionid
};
+/*
+ * routines for the domain_storage_method
+ */
+static apr_status_t loc_read_domain(int ids, domaininfo_t **domain)
+{
+ return (get_domain(domainstatsmem, domain, ids));
+}
+static int loc_get_ids_used_domain(int *ids)
+{
+ return(get_ids_used_domain(domainstatsmem, ids));
+}
+static int loc_get_max_size_domain()
+{
+ return(get_max_size_domain(domainstatsmem));
+}
+static apr_status_t loc_remove_domain(domaininfo_t *domain)
+{
+ return (remove_domain(domainstatsmem, domain));
+}
+static apr_status_t loc_insert_update_domain(domaininfo_t *domain)
+{
+ return (insert_update_domain(domainstatsmem, domain));
+}
+static apr_status_t loc_find_domain(domaininfo_t **domain, const char *route, const char *balancer)
+{
+ return (find_domain(domainstatsmem, domain, route, balancer));
+}
+static const struct domain_storage_method domain_storage =
+{
+ loc_read_domain,
+ loc_get_ids_used_domain,
+ loc_get_max_size_domain,
+ loc_remove_domain,
+ loc_insert_update_domain,
+ loc_find_domain
+};
+
/* helper for the handling of the Alias: host1,... Context: context1,... */
struct cluster_host {
char *host;
@@ -320,6 +362,7 @@
char *host;
char *balancer;
char *sessionid;
+ char *domain;
void *data;
const char *userdata_key = "mod_manager_init";
apr_uuid_t uuid;
@@ -337,12 +380,14 @@
host = apr_pstrcat(ptemp, mconf->basefilename, ".host", NULL);
balancer = apr_pstrcat(ptemp, mconf->basefilename, ".balancer", NULL);
sessionid = apr_pstrcat(ptemp, mconf->basefilename, ".sessionid", NULL);
+ domain = apr_pstrcat(ptemp, mconf->basefilename, ".domain", NULL);
} else {
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");
sessionid = ap_server_root_relative(ptemp, "logs/manager.sessionid");
+ domain = ap_server_root_relative(ptemp, "logs/manager.domain");
}
/* Get a provider to handle the shared memory */
@@ -382,6 +427,12 @@
return !OK;
}
+ domainstatsmem = create_mem_domain(domain, &mconf->maxnode, mconf->persistent, p, storage);
+ if (domainstatsmem == NULL) {
+ ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_EMERG, 0, s, "create_mem_domain failed");
+ return !OK;
+ }
+
/* Get a provider to ping/pong logics */
balancerhandler = ap_lookup_provider("proxy_cluster", "balancer", "0");
@@ -1488,6 +1539,30 @@
ap_rprintf(r, "</pre>");
}
+
+#if HAVE_CLUSTER_EX_DEBUG
+static void manager_domain(request_rec *r)
+{
+ int size, i;
+ int *id;
+
+ /* Process the domain information: the remove node belonging to a domain are stored there */
+ ap_rprintf(r, "<h1>Domain:</h1>");
+ ap_rprintf(r, "<pre>");
+ size = get_max_size_domain(domainstatsmem);
+ id = apr_palloc(r->pool, sizeof(int) * size);
+ size = get_ids_used_domain(domainstatsmem, id);
+ for (i=0; i<size; i++) {
+ domaininfo_t *ou;
+ if (get_domain(domainstatsmem, &ou, id[i]) != APR_SUCCESS)
+ continue;
+ ap_rprintf(r, "dom: %s route: %s balancer: %s\n", ou->domain, ou->JVMRoute, ou->balancer);
+ }
+ ap_rprintf(r, "</pre>");
+
+}
+#endif
+
static int count_sessionid(request_rec *r, char *route)
{
int size, i;
@@ -1772,6 +1847,9 @@
/* Display the sessions */
if (sizesessionid)
manager_sessionid(r);
+#if HAVE_CLUSTER_EX_DEBUG
+ manager_domain(r);
+#endif
ap_rputs("</body></html>\n", r);
@@ -2056,6 +2134,7 @@
ap_register_provider(p, "manager" , "shared", "2", &context_storage);
ap_register_provider(p, "manager" , "shared", "3", &balancer_storage);
ap_register_provider(p, "manager" , "shared", "4", &sessionid_storage);
+ ap_register_provider(p, "manager" , "shared", "5", &domain_storage);
}
/*
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2009-07-24 13:34:39 UTC (rev 2506)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2009-07-24 13:55:00 UTC (rev 2507)
@@ -47,6 +47,7 @@
#include "context.h"
#include "balancer.h"
#include "sessionid.h"
+#include "domain.h"
#if APR_HAVE_UNISTD_H
/* for getpid() */
@@ -72,6 +73,7 @@
static struct context_storage_method *context_storage = NULL;
static struct balancer_storage_method *balancer_storage = NULL;
static struct sessionid_storage_method *sessionid_storage = NULL;
+static struct domain_storage_method *domain_storage = NULL;
static apr_thread_mutex_t *lock = NULL;
@@ -87,6 +89,7 @@
#define TIMEINTERVAL apr_time_from_sec(1) /* recalcul the lbstatus based on number of request in the time interval */
#define TIMESESSIONID 300 /* after 5 minutes the sessionid have probably timeout */
+#define TIMEDOMAIN 300 /* after 5 minutes the sessionid have probably timeout */
/* reslist constructor */
/* XXX: Should use the proxy_util one. */
@@ -655,6 +658,31 @@
}
}
+/*
+ * remove the domain that have timeout
+ */
+static void remove_timeout_domain(apr_pool_t *pool, server_rec *server)
+{
+ int *id, size, i;
+ apr_time_t now;
+
+ now = apr_time_sec(apr_time_now());
+
+ /* read the ident of the domain */
+ id = apr_pcalloc(pool, sizeof(int) * domain_storage->get_max_size_domain());
+ size = domain_storage->get_ids_used_domain(id);
+
+ for (i=0; i<size; i++) {
+ domaininfo_t *ou;
+ if (domain_storage->read_domain(id[i], &ou) != APR_SUCCESS)
+ continue;
+ if (ou->updatetime < (now - TIMEDOMAIN)) {
+ /* Remove it */
+ domain_storage->remove_domain(ou);
+ }
+ }
+}
+
/* Retrieve the parameter with the given name
* Something like 'JSESSIONID=12345...N'
* XXX: Should use the mod_proxy_balancer ones.
@@ -1333,6 +1361,21 @@
continue;
if (ou->mess.remove && (now - ou->updatetime) >= apr_time_from_sec(WAITFORREMOVE) &&
(now - ou->mess.lastcleantry) >= apr_time_from_sec(WAITFORREMOVE)) {
+ /* if it has a domain store it in the domain */
+#if HAVE_CLUSTER_EX_DEBUG
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, server,
+ "remove_removed_node: %s %s %s", ou->mess.JVMRoute, ou->mess.balancer, ou->mess.Domain);
+#endif
+ if (ou->mess.Domain[0] != '\0') {
+ domaininfo_t dom;
+ strcpy(dom.JVMRoute, ou->mess.JVMRoute);
+ strcpy(dom.balancer, ou->mess.balancer);
+ strcpy(dom.domain, ou->mess.Domain);
+ if (domain_storage->insert_update_domain(&dom)!=APR_SUCCESS) {
+ remove_timeout_domain(pool, server);
+ domain_storage->insert_update_domain(&dom);
+ }
+ }
/* remove the node from the shared memory */
node_storage->remove_node(ou);
}
@@ -1453,10 +1496,46 @@
"proxy_cluster_post_config: Can't find mod_manager for sessionids");
return !OK;
}
+ domain_storage = ap_lookup_provider("manager" , "shared", "5");
+ if (domain_storage == NULL) {
+ ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, s,
+ "proxy_cluster_post_config: Can't find mod_manager for domains");
+ return !OK;
+ }
return OK;
}
+/* Given the route find the corresponding domain (if there is a domain) */
+static apr_status_t find_domain(request_rec *r, char **domain, char *route, const char *balancer)
+{
+ nodeinfo_t *ou;
+ domaininfo_t *dom;
+#if HAVE_CLUSTER_EX_DEBUG
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+ "find_domain: finding node for %s: %s", route, balancer);
+#endif
+ if (node_storage->find_node(&ou, route) == APR_SUCCESS) {
+ if (!strcmp(balancer, ou->mess.balancer)) {
+ if (ou->mess.Domain[0] != '\0') {
+ *domain = ou->mess.Domain;
+ }
+ return APR_SUCCESS;
+ }
+ }
+
+#if HAVE_CLUSTER_EX_DEBUG
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+ "find_domain: finding domain for %s: %s", route, balancer);
+#endif
+ /* We can't find the node, because it was removed... */
+ if (domain_storage->find_domain(&dom, route, balancer ) == APR_SUCCESS) {
+ *domain = dom->domain;
+ return APR_SUCCESS;
+ }
+ return APR_NOTFOUND;
+}
+
/**
* Find the balancer corresponding to the node information
*/
@@ -1473,6 +1552,8 @@
if (balancer->sticky == NULL)
continue;
+ if (strlen(balancer->name)<=11)
+ continue;
sessionid = cluster_get_sessionid(r, balancer->sticky, r->uri, &sticky_used);
if (sessionid) {
@@ -1482,34 +1563,32 @@
if ((route = strchr(sessionid, '.')) != NULL )
route++;
if (route && *route) {
- nodeinfo_t *ou;
+ char *domain = NULL;
#if HAVE_CLUSTER_EX_DEBUG
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
"cluster: Found route %s", route);
#endif
- if (node_storage->find_node(&ou, route) == APR_SUCCESS) {
- if (strlen(balancer->name)>11 && !strcmp(&balancer->name[11], ou->mess.balancer)) {
+ if (find_domain(r, &domain, route, &balancer->name[11]) == APR_SUCCESS) {
#if HAVE_CLUSTER_EX_DEBUG
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "cluster: Found balancer %s for %s", ou->mess.balancer, route);
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+ "cluster: Found balancer %s for %s", &balancer->name[11], route);
#endif
- /* here we have the route and domain for find_session_route ... */
- apr_table_setn(r->notes, "session-sticky", sticky_used);
- if (sessionid_storage)
- apr_table_setn(r->notes, "session-id", sessionid);
- apr_table_setn(r->notes, "session-route", route);
+ /* here we have the route and domain for find_session_route ... */
+ apr_table_setn(r->notes, "session-sticky", sticky_used);
+ if (sessionid_storage)
+ apr_table_setn(r->notes, "session-id", sessionid);
+ apr_table_setn(r->notes, "session-route", route);
- apr_table_setn(r->subprocess_env, "BALANCER_SESSION_ROUTE", route);
- apr_table_setn(r->subprocess_env, "BALANCER_SESSION_STICKY", sticky_used);
- if (ou->mess.Domain[0] != '\0') {
+ apr_table_setn(r->subprocess_env, "BALANCER_SESSION_ROUTE", route);
+ apr_table_setn(r->subprocess_env, "BALANCER_SESSION_STICKY", sticky_used);
+ if (domain) {
#if HAVE_CLUSTER_EX_DEBUG
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "cluster: Found domain %s for %s", ou->mess.Domain, route);
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+ "cluster: Found domain %s for %s", domain, route);
#endif
- apr_table_setn(r->notes, "CLUSTER_DOMAIN", ou->mess.Domain);
- }
- return &balancer->name[11];
+ apr_table_setn(r->notes, "CLUSTER_DOMAIN", domain);
}
+ return &balancer->name[11];
}
}
}
15 years, 5 months
JBoss Native SVN: r2506 - in trunk/mod_cluster/test/java: org/jboss/mod_cluster and 1 other directory.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-07-24 09:34:39 -0400 (Fri, 24 Jul 2009)
New Revision: 2506
Added:
trunk/mod_cluster/test/java/org/jboss/mod_cluster/Util.java
Modified:
trunk/mod_cluster/test/java/build.xml
trunk/mod_cluster/test/java/org/jboss/mod_cluster/Domaintest.java
Log:
Improve the logic to test the domain logic.
Modified: trunk/mod_cluster/test/java/build.xml
===================================================================
--- trunk/mod_cluster/test/java/build.xml 2009-07-24 10:12:48 UTC (rev 2505)
+++ trunk/mod_cluster/test/java/build.xml 2009-07-24 13:34:39 UTC (rev 2506)
@@ -208,28 +208,58 @@
</java>
<echo message="startjbossweb ${line}"/>
</target>
- <target name="domain" depends="compile">
- <copy file="conf/web.xml" todir="${test.classes}/conf"/>
- <!-- Create 4 server with a port to stop them -->
+ <target name="start4jbossweb" depends="compile">
<antcall target="startjbossweb">
- <param name="line" value="8009 node1 dom1 8005"/>
+ <param name="line" value="8009 ${basenode}1 dom1 8005"/>
</antcall>
<antcall target="startjbossweb">
- <param name="line" value="8010 node2 dom1 8006"/>
+ <param name="line" value="8010 ${basenode}2 dom1 8006"/>
</antcall>
<antcall target="startjbossweb">
- <param name="line" value="8011 node3 dom2 8007"/>
+ <param name="line" value="8011 ${basenode}3 dom2 8007"/>
</antcall>
<antcall target="startjbossweb">
- <param name="line" value="8012 node4 dom2 8008"/>
+ <param name="line" value="8012 ${basenode}4 dom2 8008"/>
</antcall>
+ </target>
+ <target name="startstop4jbossweb">
+ <antcall target="start4jbossweb">
+ <param name="basenode" value="${basenode}"/>
+ </antcall>
+ <java dir="${test.classes}" classname="org.jboss.mod_cluster.Util" fork="yes" failonerror="${test.failonerror}">
+ <classpath refid="tomcat.test.classpath"/>
+ </java>
+ </target>
+ <target name="domain20" depends="compile">
+ <!-- Create 4 server with a port to stop them -->
+ <antcall target="startstop4jbossweb">
+ <param name="basenode" value="aaaa"/>
+ </antcall>
+ <antcall target="startstop4jbossweb">
+ <param name="basenode" value="bbbb"/>
+ </antcall>
+ <antcall target="startstop4jbossweb">
+ <param name="basenode" value="cccc"/>
+ </antcall>
+ <antcall target="startstop4jbossweb">
+ <param name="basenode" value="dddd"/>
+ </antcall>
+ <antcall target="startstop4jbossweb">
+ <param name="basenode" value="eeee"/>
+ </antcall>
+ </target>
+ <target name="domain" depends="compile">
+ <copy file="conf/web.xml" todir="${test.classes}/conf"/>
+ <!-- Create 4 server for the test -->
+ <antcall target="start4jbossweb">
+ <param name="basenode" value="node"/>
+ </antcall>
<!-- Run a test : connect, get the node, stop it and check we stay on the domain -->
<java dir="${test.classes}" classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
<arg value="org.jboss.mod_cluster.Maintest"/>
<jvmarg line="-Dcluster=${cluster} -Dtest=Domaintest"/>
<classpath refid="tomcat.test.classpath"/>
</java>
-
</target>
<!-- Download and dependency building -->
Modified: trunk/mod_cluster/test/java/org/jboss/mod_cluster/Domaintest.java
===================================================================
--- trunk/mod_cluster/test/java/org/jboss/mod_cluster/Domaintest.java 2009-07-24 10:12:48 UTC (rev 2505)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/Domaintest.java 2009-07-24 13:34:39 UTC (rev 2506)
@@ -75,7 +75,7 @@
clienterror = true;
if (clienterror) {
- stopAll();
+ Util.stopAll();
fail("Client error");
}
@@ -93,7 +93,7 @@
stopport = 8008;
}
client.setnode(node);
- stopNode(stopport);
+ Util.stopNode(stopport);
try {
client.start();
client.join();
@@ -108,29 +108,7 @@
System.out.println("Test FAILED");
clienterror = true;
}
- stopAll();
+ Util.stopAll();
}
-
- public void stopNode(int port) {
- System.out.println("Stopping: " + port);
- try {
- Socket socket = new Socket("localhost", port);
- PrintWriter out = new PrintWriter(socket.getOutputStream());
- InputStream in = socket.getInputStream();
- out.print("SHUTDOWN");
- out.flush();
- in.read();
- socket.close();
- } catch (Exception ex) {
- ex.printStackTrace(System.out);
- }
- System.out.println("Stopped: " + port);
- }
- public void stopAll() {
- stopNode(8005);
- stopNode(8006);
- stopNode(8007);
- stopNode(8008);
- }
}
Added: trunk/mod_cluster/test/java/org/jboss/mod_cluster/Util.java
===================================================================
--- trunk/mod_cluster/test/java/org/jboss/mod_cluster/Util.java (rev 0)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/Util.java 2009-07-24 13:34:39 UTC (rev 2506)
@@ -0,0 +1,67 @@
+/*
+ * mod_cluster
+ *
+ * Copyright(c) 2009 Red Hat Middleware, LLC,
+ * and individual contributors as indicated by the @authors tag.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library in the file COPYING.LIB;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *
+ * @author Jean-Frederic Clere
+ * @version $Revision$
+ */
+
+package org.jboss.mod_cluster;
+
+import java.lang.Exception;
+import java.net.Socket;
+import java.io.PrintWriter;
+import java.io.InputStream;
+
+public class Util {
+
+ public static void stopNode(int port) {
+ System.out.println("Stopping: " + port);
+ try {
+ Socket socket = new Socket("localhost", port);
+ PrintWriter out = new PrintWriter(socket.getOutputStream());
+ InputStream in = socket.getInputStream();
+ out.print("SHUTDOWN");
+ out.flush();
+ in.read();
+ socket.close();
+ } catch (Exception ex) {
+ ex.printStackTrace(System.out);
+ }
+ System.out.println("Stopped: " + port);
+ }
+ public static void stopAll() {
+ stopNode(8005);
+ stopNode(8006);
+ stopNode(8007);
+ stopNode(8008);
+ }
+ public static void main(String[] args) {
+ try {
+
+ Thread.currentThread().sleep(5000);
+ }
+ catch(InterruptedException ie){
+ }
+ stopAll();
+ }
+}
15 years, 5 months
JBoss Native SVN: r2505 - trunk/mod_cluster/test/java.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-07-24 06:12:48 -0400 (Fri, 24 Jul 2009)
New Revision: 2505
Modified:
trunk/mod_cluster/test/java/build.xml
Log:
Make it simpler to read.
Modified: trunk/mod_cluster/test/java/build.xml
===================================================================
--- trunk/mod_cluster/test/java/build.xml 2009-07-24 09:35:04 UTC (rev 2504)
+++ trunk/mod_cluster/test/java/build.xml 2009-07-24 10:12:48 UTC (rev 2505)
@@ -199,33 +199,30 @@
</target>
<!-- Test the domain logic -->
- <target name="domain" depends="compile">
- <copy file="conf/web.xml" todir="${test.classes}/conf"/>
- <!-- Create 4 server with a port to stop them -->
+ <target name="startjbossweb">
<java dir="${test.classes}" classname="org.jboss.mod_cluster.StartJBossWeb"
spawn="true" fork="yes">
- <arg line="8009 node1 dom1 8005"/>
+ <arg line="${line}"/>
<jvmarg line="-Dcluster=${cluster}"/>
<classpath refid="tomcat.test.classpath"/>
</java>
- <java dir="${test.classes}" classname="org.jboss.mod_cluster.StartJBossWeb"
- spawn="true" fork="yes">
- <arg line="8010 node2 dom1 8006"/>
- <jvmarg line="-Dcluster=${cluster}"/>
- <classpath refid="tomcat.test.classpath"/>
- </java>
- <java dir="${test.classes}" classname="org.jboss.mod_cluster.StartJBossWeb"
- spawn="true" fork="yes">
- <arg line="8011 node3 dom2 8007"/>
- <jvmarg line="-Dcluster=${cluster}"/>
- <classpath refid="tomcat.test.classpath"/>
- </java>
- <java dir="${test.classes}" classname="org.jboss.mod_cluster.StartJBossWeb"
- spawn="true" fork="yes">
- <arg line="8012 node4 dom2 8008"/>
- <jvmarg line="-Dcluster=${cluster}"/>
- <classpath refid="tomcat.test.classpath"/>
- </java>
+ <echo message="startjbossweb ${line}"/>
+ </target>
+ <target name="domain" depends="compile">
+ <copy file="conf/web.xml" todir="${test.classes}/conf"/>
+ <!-- Create 4 server with a port to stop them -->
+ <antcall target="startjbossweb">
+ <param name="line" value="8009 node1 dom1 8005"/>
+ </antcall>
+ <antcall target="startjbossweb">
+ <param name="line" value="8010 node2 dom1 8006"/>
+ </antcall>
+ <antcall target="startjbossweb">
+ <param name="line" value="8011 node3 dom2 8007"/>
+ </antcall>
+ <antcall target="startjbossweb">
+ <param name="line" value="8012 node4 dom2 8008"/>
+ </antcall>
<!-- Run a test : connect, get the node, stop it and check we stay on the domain -->
<java dir="${test.classes}" classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
<arg value="org.jboss.mod_cluster.Maintest"/>
15 years, 5 months
JBoss Native SVN: r2504 - trunk/mod_cluster/test/java.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-07-24 05:35:04 -0400 (Fri, 24 Jul 2009)
New Revision: 2504
Modified:
trunk/mod_cluster/test/java/build.xml
Log:
Arrange the domain test.
Modified: trunk/mod_cluster/test/java/build.xml
===================================================================
--- trunk/mod_cluster/test/java/build.xml 2009-07-22 10:13:11 UTC (rev 2503)
+++ trunk/mod_cluster/test/java/build.xml 2009-07-24 09:35:04 UTC (rev 2504)
@@ -203,25 +203,25 @@
<copy file="conf/web.xml" todir="${test.classes}/conf"/>
<!-- Create 4 server with a port to stop them -->
<java dir="${test.classes}" classname="org.jboss.mod_cluster.StartJBossWeb"
- spawn="true" fork="yes" failonerror="${test.failonerror}">
+ spawn="true" fork="yes">
<arg line="8009 node1 dom1 8005"/>
<jvmarg line="-Dcluster=${cluster}"/>
<classpath refid="tomcat.test.classpath"/>
</java>
<java dir="${test.classes}" classname="org.jboss.mod_cluster.StartJBossWeb"
- spawn="true" fork="yes" failonerror="${test.failonerror}">
+ spawn="true" fork="yes">
<arg line="8010 node2 dom1 8006"/>
<jvmarg line="-Dcluster=${cluster}"/>
<classpath refid="tomcat.test.classpath"/>
</java>
<java dir="${test.classes}" classname="org.jboss.mod_cluster.StartJBossWeb"
- spawn="true" fork="yes" failonerror="${test.failonerror}">
+ spawn="true" fork="yes">
<arg line="8011 node3 dom2 8007"/>
<jvmarg line="-Dcluster=${cluster}"/>
<classpath refid="tomcat.test.classpath"/>
</java>
<java dir="${test.classes}" classname="org.jboss.mod_cluster.StartJBossWeb"
- spawn="true" fork="yes" failonerror="${test.failonerror}">
+ spawn="true" fork="yes">
<arg line="8012 node4 dom2 8008"/>
<jvmarg line="-Dcluster=${cluster}"/>
<classpath refid="tomcat.test.classpath"/>
15 years, 5 months
JBoss Native SVN: r2503 - trunk/mod_cluster/test/java.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-07-22 06:13:11 -0400 (Wed, 22 Jul 2009)
New Revision: 2503
Modified:
trunk/mod_cluster/test/java/build.xml
Log:
Start httpd via apachectl on macosx too.
Modified: trunk/mod_cluster/test/java/build.xml
===================================================================
--- trunk/mod_cluster/test/java/build.xml 2009-07-22 09:18:59 UTC (rev 2502)
+++ trunk/mod_cluster/test/java/build.xml 2009-07-22 10:13:11 UTC (rev 2503)
@@ -112,7 +112,7 @@
<delete file="apache.bat"/>
<copy file="apachectl.bat" tofile="apache.bat" />
<replace file="apache.bat" token="@BASELOC@" value="${base.apache}"/>
- <exec executable="${base.apache}/opt/jboss/httpd/sbin/apachectl" os="Linux,SunOS,HP-UX">
+ <exec executable="${base.apache}/opt/jboss/httpd/sbin/apachectl" os="Linux,SunOS,HP-UX,Mac OS X">
<arg value="start"/>
</exec>
<exec executable="apache.bat" os="Windows 2003">
@@ -127,7 +127,7 @@
</exec>
</target>
<target name="stophttpd">
- <exec executable="${base.apache}/opt/jboss/httpd/sbin/apachectl" os="Linux,SunOS,HP-UX">
+ <exec executable="${base.apache}/opt/jboss/httpd/sbin/apachectl" os="Linux,SunOS,HP-UX,Mac OS X">
<arg value="stop"/>
</exec>
<exec executable="apache.bat" os="Windows 2003">
15 years, 5 months
JBoss Native SVN: r2502 - trunk/build/patch.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-07-22 05:18:59 -0400 (Wed, 22 Jul 2009)
New Revision: 2502
Modified:
trunk/build/patch/httpd-2.2.11.patch
Log:
Add a patch for macosx mod_ssl, otherwise error:
_ssl_cmd_SSLCACertificateFile\n Referenced from: /Users/hudson/java/Mac/OS/X-10.5.7-i386/opt/jboss/httpd/lib/httpd/modules/mod_ssl.so\n
Modified: trunk/build/patch/httpd-2.2.11.patch
===================================================================
--- trunk/build/patch/httpd-2.2.11.patch 2009-07-22 06:34:24 UTC (rev 2501)
+++ trunk/build/patch/httpd-2.2.11.patch 2009-07-22 09:18:59 UTC (rev 2502)
@@ -96,3 +96,20 @@
else
ltpath=`dirname $libtoolize`
ltfile=${LIBTOOL_M4-`cd $ltpath/../share/aclocal ; pwd`/libtool.m4}
+--- modules/ssl/config.m4 (revision 793871)
++++ modules/ssl/config.m4 (working copy)
+@@ -120,7 +120,13 @@
+ if test "x$enable_ssl" = "xshared"; then
+ # The only symbol which needs to be exported is the module
+ # structure, so ask libtool to hide everything else:
+- APR_ADDTO(MOD_SSL_LDADD, [-export-symbols-regex ssl_module])
++ case $host in
++ *-apple-darwin*)
++ ;;
++ *)
++ APR_ADDTO(MOD_SSL_LDADD, [-export-symbols-regex ssl_module])
++ ;;
++ esac
+ fi
+ ])
+
15 years, 5 months