mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 22:31:28 +02:00
BUG/MEDIUM: peers: local peer socket not bound.
This bug came with 015e4d7 commit: "MINOR: stick-tables: Add peers process binding computing" where the "stick" rules cases were missing when computing the peer local listener process binding. At parsing time we store in the stick-table struct ->proxies_list the proxies which refer to this stick-table. The process binding is computed after having parsed the entire configuration file with this simple loop in cfgparse.c: /* compute the required process bindings for the peers from <stktables_list> * for all the stick-tables, the ones coming with "peers" sections included. */ for (t = stktables_list; t; t = t->next) { struct proxy *p; for (p = t->proxies_list; p; p = p->next_stkt_ref) { if (t->peers.p && t->peers.p->peers_fe) { t->peers.p->peers_fe->bind_proc |= p->bind_proc; } } } Note that if this process binding is not correctly initialized, the child forked by the master-worker stops the peer local listener. Should be also the case when daemonizing haproxy. Must be backported to 2.0.
This commit is contained in:
parent
cc1eb1619f
commit
9c3a0ceeac
@ -2726,6 +2726,10 @@ int check_config_validity()
|
|||||||
mrule->table.t = target;
|
mrule->table.t = target;
|
||||||
stktable_alloc_data_type(target, STKTABLE_DT_SERVER_ID, NULL);
|
stktable_alloc_data_type(target, STKTABLE_DT_SERVER_ID, NULL);
|
||||||
stktable_alloc_data_type(target, STKTABLE_DT_SERVER_NAME, NULL);
|
stktable_alloc_data_type(target, STKTABLE_DT_SERVER_NAME, NULL);
|
||||||
|
if (!in_proxies_list(target->proxies_list, curproxy)) {
|
||||||
|
curproxy->next_stkt_ref = target->proxies_list;
|
||||||
|
target->proxies_list = curproxy;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2760,6 +2764,10 @@ int check_config_validity()
|
|||||||
mrule->table.t = target;
|
mrule->table.t = target;
|
||||||
stktable_alloc_data_type(target, STKTABLE_DT_SERVER_ID, NULL);
|
stktable_alloc_data_type(target, STKTABLE_DT_SERVER_ID, NULL);
|
||||||
stktable_alloc_data_type(target, STKTABLE_DT_SERVER_NAME, NULL);
|
stktable_alloc_data_type(target, STKTABLE_DT_SERVER_NAME, NULL);
|
||||||
|
if (!in_proxies_list(target->proxies_list, curproxy)) {
|
||||||
|
curproxy->next_stkt_ref = target->proxies_list;
|
||||||
|
target->proxies_list = curproxy;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user