mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
* Do not reset lbstatus, lbfactor and lbset if the shared proxy_worker_stat
structure for a worker is already initialized by the same or another process. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@574485 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
#define CORE_PRIVATE
|
#define CORE_PRIVATE
|
||||||
|
|
||||||
#include "mod_proxy.h"
|
#include "mod_proxy.h"
|
||||||
|
#include "scoreboard.h"
|
||||||
#include "ap_mpm.h"
|
#include "ap_mpm.h"
|
||||||
#include "apr_version.h"
|
#include "apr_version.h"
|
||||||
#include "apr_hooks.h"
|
#include "apr_hooks.h"
|
||||||
@@ -86,22 +87,37 @@ static int init_balancer_members(proxy_server_conf *conf, server_rec *s,
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
proxy_worker *workers;
|
proxy_worker *workers;
|
||||||
|
int worker_is_initialized;
|
||||||
|
proxy_worker_stat *slot;
|
||||||
|
|
||||||
workers = (proxy_worker *)balancer->workers->elts;
|
workers = (proxy_worker *)balancer->workers->elts;
|
||||||
|
|
||||||
for (i = 0; i < balancer->workers->nelts; i++) {
|
for (i = 0; i < balancer->workers->nelts; i++) {
|
||||||
|
worker_is_initialized = PROXY_WORKER_IS_INITIALIZED(workers);
|
||||||
|
if (!worker_is_initialized) {
|
||||||
|
/*
|
||||||
|
* If the worker is not initialized check whether its scoreboard
|
||||||
|
* slot is already initialized.
|
||||||
|
*/
|
||||||
|
slot = (proxy_worker_stat *) ap_get_scoreboard_lb(workers->id);
|
||||||
|
if (slot) {
|
||||||
|
worker_is_initialized = slot->status & PROXY_WORKER_INITIALIZED;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
worker_is_initialized = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
ap_proxy_initialize_worker_share(conf, workers, s);
|
ap_proxy_initialize_worker_share(conf, workers, s);
|
||||||
ap_proxy_initialize_worker(workers, s);
|
ap_proxy_initialize_worker(workers, s);
|
||||||
|
if (!worker_is_initialized) {
|
||||||
|
/* Set to the original configuration */
|
||||||
|
workers->s->lbstatus = workers->s->lbfactor =
|
||||||
|
(workers->lbfactor ? workers->lbfactor : 1);
|
||||||
|
workers->s->lbset = workers->lbset;
|
||||||
|
}
|
||||||
++workers;
|
++workers;
|
||||||
}
|
}
|
||||||
|
|
||||||
workers = (proxy_worker *)balancer->workers->elts;
|
|
||||||
for (i = 0; i < balancer->workers->nelts; i++) {
|
|
||||||
/* Set to the original configuration */
|
|
||||||
workers[i].s->lbstatus = workers[i].s->lbfactor =
|
|
||||||
(workers[i].lbfactor ? workers[i].lbfactor : 1);
|
|
||||||
workers[i].s->lbset = workers[i].lbset;
|
|
||||||
}
|
|
||||||
/* Set default number of attempts to the number of
|
/* Set default number of attempts to the number of
|
||||||
* workers.
|
* workers.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user