ASF Bugzilla – Attachment 32095 Details for
Bug 44736
mod_proxy_balancer looses it's mind on reloads.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch v5
httpd-2.2.30-graceful-share.patch (text/plain), 3.65 KB, created by
jkaluza
on 2014-10-09 06:35:27 UTC
(
hide
)
Description:
proposed patch v5
Filename:
MIME Type:
Creator:
jkaluza
Created:
2014-10-09 06:35:27 UTC
Size:
3.65 KB
patch
obsolete
>Index: modules/proxy/mod_proxy.h >=================================================================== >--- modules/proxy/mod_proxy.h (revision 1629836) >+++ modules/proxy/mod_proxy.h (working copy) >@@ -308,6 +308,7 @@ > void *context; /* general purpose storage */ > apr_size_t busy; /* busyness factor */ > int lbset; /* load balancer cluster set */ >+ unsigned char digest[APR_MD5_DIGESTSIZE]; /* hash of the worker->name */ > } proxy_worker_stat; > > /* Worker configuration */ >@@ -772,6 +773,10 @@ > ap_proxy_buckets_lifetime_transform(request_rec *r, apr_bucket_brigade *from, > apr_bucket_brigade *to); > >+#if PROXY_HAS_SCOREBOARD >+void *ap_proxy_set_scoreboard_lb(proxy_worker *worker); >+#endif >+ > #define PROXY_LBMETHOD "proxylbmethod" > > /* The number of dynamic workers that can be added when reconfiguring. >Index: modules/proxy/mod_proxy_balancer.c >=================================================================== >--- modules/proxy/mod_proxy_balancer.c (revision 1629836) >+++ modules/proxy/mod_proxy_balancer.c (working copy) >@@ -94,7 +94,7 @@ > * If the worker is not initialized check whether its scoreboard > * slot is already initialized. > */ >- slot = (proxy_worker_stat *) ap_get_scoreboard_lb(workers->id); >+ slot = (proxy_worker_stat *) ap_proxy_set_scoreboard_lb(workers); > if (slot) { > worker_is_initialized = slot->status & PROXY_WORKER_INITIALIZED; > } >Index: modules/proxy/proxy_util.c >=================================================================== >--- modules/proxy/proxy_util.c (revision 1629836) >+++ modules/proxy/proxy_util.c (working copy) >@@ -1794,6 +1794,42 @@ > } > #endif > >+#if PROXY_HAS_SCOREBOARD >+void *ap_proxy_set_scoreboard_lb(proxy_worker *worker) { >+ int i = 0; >+ proxy_worker_stat *free_slot = NULL; >+ proxy_worker_stat *s; >+ unsigned char digest[APR_MD5_DIGESTSIZE]; >+ >+ if (!ap_scoreboard_image) { >+ return NULL; >+ } >+ >+ if (worker->s) { >+ return worker->s; >+ } >+ >+ apr_md5(digest, (const unsigned char *) worker->name, >+ strlen(worker->name)); >+ >+ /* Try to find out the right shared memory according to the hash >+ * of worker->name. */ >+ while ((s = (proxy_worker_stat *)ap_get_scoreboard_lb(i++)) != NULL) { >+ if (memcmp(s->digest, digest, APR_MD5_DIGESTSIZE) == 0) { >+ worker->s = s; >+ return s; >+ } >+ else if (s->status == 0 && free_slot == NULL) { >+ free_slot = s; >+ } >+ } >+ >+ /* We failed to find out shared memory, so just use free slot */ >+ worker->s = free_slot; >+ return free_slot; >+}; >+#endif >+ > /* > * ap_proxy_initialize_worker_share() concerns itself > * with initializing those parts of worker which >@@ -1819,10 +1855,10 @@ > #if PROXY_HAS_SCOREBOARD > /* Get scoreboard slot */ > if (ap_scoreboard_image) { >- score = ap_get_scoreboard_lb(worker->id); >+ score = ap_proxy_set_scoreboard_lb(worker); > if (!score) { > ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, >- "proxy: ap_get_scoreboard_lb(%d) failed in child %" APR_PID_T_FMT " for worker %s", >+ "proxy: ap_proxy_get_scoreboard_lb(%d) failed in child %" APR_PID_T_FMT " for worker %s", > worker->id, getpid(), worker->name); > } > else { >@@ -1863,6 +1899,9 @@ > *worker->s->redirect = '\0'; > } > >+ apr_md5(worker->s->digest, (const unsigned char *) worker->name, >+ strlen(worker->name)); >+ > worker->s->status |= (worker->status | PROXY_WORKER_INITIALIZED); > > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 44736
:
26555
|
32086
|
32087
|
32091
|
32093
|
32095
|
32098
|
32159