Author: jfrederic.clere(a)jboss.com
Date: 2008-06-25 11:34:04 -0400 (Wed, 25 Jun 2008)
New Revision: 1728
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
(Re)create the connection pool when reusing the worker.
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-25 10:13:25 UTC
(rev 1727)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-06-25 15:34:04 UTC
(rev 1728)
@@ -105,6 +105,16 @@
/* We are going to reuse a removed one */
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, server,
"Created: reusing worker for %s", url);
+ if ((*worker)->cp->pool == NULL) {
+ /* Copied for init_conn_pool in modules/proxy/proxy_util.c */
+ apr_pool_t *pool;
+ proxy_conn_pool *cp;
+ apr_pool_create(&pool, conf->pool);
+ apr_pool_tag(pool, "proxy_worker_cp");
+ cp = (proxy_conn_pool *)apr_pcalloc(conf->pool, sizeof(proxy_conn_pool));
+ cp->pool = pool;
+ (*worker)->cp = cp;
+ }
reuse = 1;
} else {
return; /* Done Already existing */
@@ -281,6 +291,8 @@
}
worker->id = 0;
+ /* XXX: Shouldnn't we remove the mutex too (worker->mutex) */
+
/* XXX: How to remove the worker from the apr_array of the balancer */
return (0);
Show replies by date