Author: jfrederic.clere(a)jboss.com
Date: 2008-06-24 05:32:17 -0400 (Tue, 24 Jun 2008)
New Revision: 1725
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Arrange small problems...
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-06-20 07:48:51 UTC
(rev 1724)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-06-24 09:32:17 UTC
(rev 1725)
@@ -183,6 +183,7 @@
/*
* Add a node to the worker conf
+ * NOTE: pool is the request pool or any temporary pool. Use conf->pool for any data
that live longer.
*/
static void add_workers_node(nodeinfo_t *node, proxy_server_conf *conf, apr_pool_t *pool,
server_rec *server)
{
@@ -219,7 +220,7 @@
/* Something like cluster://cluster1 and cluster1 */
if (strcmp(balan->balancer, &balancer->name[10]) == 0) {
/* XXX: StickySession, StickySessionRemove not in */
- balancer->sticky = apr_psprintf(pool, "%s|%s",
balan->StickySessionCookie,
+ balancer->sticky = apr_psprintf(conf->pool, "%s|%s",
balan->StickySessionCookie,
balan->StickySessionPath);
balancer->sticky_force = balan->StickySessionForce;
balancer->timeout = apr_time_from_sec(balan->Timeout);
@@ -866,6 +867,7 @@
#endif
{
/* create the new connection if the previous was destroyed */
+ rv = APR_SUCCESS;
if (!worker->cp->conn) {
/* XXX: What appends is worker->cp->pool is NULL */
if (worker->cp->pool)
@@ -877,7 +879,6 @@
conn = worker->cp->conn;
worker->cp->conn = NULL;
}
- rv = APR_SUCCESS;
}
if (rv != APR_SUCCESS) {
@@ -1393,13 +1394,18 @@
* If balancer is already provided skip the search
* for balancer, because this is failover attempt.
*/
+ apr_thread_mutex_lock(lock);
if (!*balancer &&
- !(*balancer = ap_proxy_get_balancer(r->pool, conf, *url)))
+ !(*balancer = ap_proxy_get_balancer(r->pool, conf, *url))) {
+ apr_thread_mutex_unlock(lock);
return DECLINED;
+ }
/* Step 2: find the session route */
runtime = find_session_route(*balancer, r, &route, &sticky, url);
+ apr_thread_mutex_unlock(lock);
+
/* Lock the LoadBalancer
* XXX: perhaps we need the process lock here
*/
Show replies by date