MINOR: servers: Move the per-thread server initialization earlier
Move the code responsible for calling per-thread server initialization earlier than it was done, so that per-thread structures are available a bit later, when we initialize load-balancing.
This commit is contained in:
parent
9a8c4df45d
commit
e7613d3717
@ -2789,6 +2789,32 @@ int check_config_validity()
|
|||||||
proxies_list = next;
|
proxies_list = next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* we must finish to initialize certain things on the servers,
|
||||||
|
* as some of the per_thr/per_tgrp fields may be accessed soon
|
||||||
|
*/
|
||||||
|
|
||||||
|
MT_LIST_FOR_EACH_ENTRY_LOCKED(newsrv, &servers_list, global_list, back) {
|
||||||
|
if (srv_init_per_thr(newsrv) == -1) {
|
||||||
|
ha_alert("parsing [%s:%d] : failed to allocate per-thread lists for server '%s'.\n",
|
||||||
|
newsrv->conf.file, newsrv->conf.line, newsrv->id);
|
||||||
|
cfgerr++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* initialize idle conns lists */
|
||||||
|
if (newsrv->max_idle_conns != 0) {
|
||||||
|
newsrv->curr_idle_thr = calloc(global.nbthread, sizeof(*newsrv->curr_idle_thr));
|
||||||
|
if (!newsrv->curr_idle_thr) {
|
||||||
|
ha_alert("parsing [%s:%d] : failed to allocate idle connection tasks for server '%s'.\n",
|
||||||
|
newsrv->conf.file, newsrv->conf.line, newsrv->id);
|
||||||
|
cfgerr++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* starting to initialize the main proxies list */
|
/* starting to initialize the main proxies list */
|
||||||
init_proxies_list = proxies_list;
|
init_proxies_list = proxies_list;
|
||||||
|
|
||||||
@ -4142,29 +4168,6 @@ out_uri_auth_compat:
|
|||||||
/* At this point, target names have already been resolved. */
|
/* At this point, target names have already been resolved. */
|
||||||
/***********************************************************/
|
/***********************************************************/
|
||||||
|
|
||||||
/* we must finish to initialize certain things on the servers */
|
|
||||||
|
|
||||||
MT_LIST_FOR_EACH_ENTRY_LOCKED(newsrv, &servers_list, global_list, back) {
|
|
||||||
/* initialize idle conns lists */
|
|
||||||
if (srv_init_per_thr(newsrv) == -1) {
|
|
||||||
ha_alert("parsing [%s:%d] : failed to allocate per-thread lists for server '%s'.\n",
|
|
||||||
newsrv->conf.file, newsrv->conf.line, newsrv->id);
|
|
||||||
cfgerr++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (newsrv->max_idle_conns != 0) {
|
|
||||||
newsrv->curr_idle_thr = calloc(global.nbthread, sizeof(*newsrv->curr_idle_thr));
|
|
||||||
if (!newsrv->curr_idle_thr) {
|
|
||||||
ha_alert("parsing [%s:%d] : failed to allocate idle connection tasks for server '%s'.\n",
|
|
||||||
newsrv->conf.file, newsrv->conf.line, newsrv->id);
|
|
||||||
cfgerr++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
idle_conn_task = task_new_anywhere();
|
idle_conn_task = task_new_anywhere();
|
||||||
if (!idle_conn_task) {
|
if (!idle_conn_task) {
|
||||||
ha_alert("parsing : failed to allocate global idle connection task.\n");
|
ha_alert("parsing : failed to allocate global idle connection task.\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user