ASF Bugzilla – Attachment 32086 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
httpd-2.2.30-graceful-share.patch (text/plain), 3.41 KB, created by
jkaluza
on 2014-10-07 11:24:09 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
jkaluza
Created:
2014-10-07 11:24:09 UTC
Size:
3.41 KB
patch
obsolete
>Index: modules/proxy/mod_proxy.h >=================================================================== >--- modules/proxy/mod_proxy.h (revision 1629836) >+++ modules/proxy/mod_proxy.h (working copy) >@@ -292,6 +292,7 @@ > /* default worker retry timeout in seconds */ > #define PROXY_WORKER_DEFAULT_RETRY 60 > #define PROXY_WORKER_MAX_ROUTE_SIZ 63 >+#define PROXY_WORKER_MAX_NAME_SIZE 255 > > /* Runtime worker status informations. Shared in scoreboard */ > typedef struct { >@@ -308,6 +309,7 @@ > void *context; /* general purpose storage */ > apr_size_t busy; /* busyness factor */ > int lbset; /* load balancer cluster set */ >+ char name[PROXY_WORKER_MAX_NAME_SIZE+1]; > } proxy_worker_stat; > > /* Worker configuration */ >@@ -772,6 +774,10 @@ > ap_proxy_buckets_lifetime_transform(request_rec *r, apr_bucket_brigade *from, > apr_bucket_brigade *to); > >+#if PROXY_HAS_SCOREBOARD >+void *ap_proxy_get_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_get_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,31 @@ > } > #endif > >+#if PROXY_HAS_SCOREBOARD >+void *ap_proxy_get_scoreboard_lb(proxy_worker *worker) { >+ int i = 0; >+ proxy_worker_stat *free_slot = NULL; >+ proxy_worker_stat *s; >+ >+ if (!ap_scoreboard_image) { >+ return NULL; >+ } >+ >+ /* Try to find out the right shared memory according to worker->name. */ >+ while ((s = (proxy_worker_stat *)ap_get_scoreboard_lb(i++)) != NULL) { >+ if (strncmp(worker->name, s->name, PROXY_WORKER_MAX_NAME_SIZE) == 0) { >+ 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 */ >+ return free_slot; >+}; >+#endif >+ > /* > * ap_proxy_initialize_worker_share() concerns itself > * with initializing those parts of worker which >@@ -1819,7 +1844,7 @@ > #if PROXY_HAS_SCOREBOARD > /* Get scoreboard slot */ > if (ap_scoreboard_image) { >- score = ap_get_scoreboard_lb(worker->id); >+ score = get_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", >@@ -1862,6 +1887,7 @@ > else { > *worker->s->redirect = '\0'; > } >+ strncpy(worker->s->name, worker->name, PROXY_WORKER_MAX_NAME_SIZE); > > 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