mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 15:17:01 +02:00
MINOR: peers: Add functions to commit peer changes from the resync task
For now, nothing is done in these functions. It is only a patch to prepare the huge part of the refactoring about the locking mechanism of the peers. These functions will be responsible to check peers state and their learn status to update the peers section flags accordingly.
This commit is contained in:
parent
4a16560315
commit
bdf1634883
14
src/peers.c
14
src/peers.c
@ -3411,6 +3411,14 @@ static struct appctx *peer_session_create(struct peers *peers, struct peer *peer
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void __process_peer_learn_status(struct peers *peers, struct peer *peer)
|
||||
{
|
||||
}
|
||||
|
||||
static void __process_peer_state(struct peers *peers, struct peer *peer)
|
||||
{
|
||||
}
|
||||
|
||||
static void __process_running_peer_sync(struct task *task, struct peers *peers, unsigned int state)
|
||||
{
|
||||
struct peer *ps;
|
||||
@ -3447,6 +3455,9 @@ static void __process_running_peer_sync(struct task *task, struct peers *peers,
|
||||
|
||||
/* For each session */
|
||||
for (ps = peers->remote; ps; ps = ps->next) {
|
||||
__process_peer_learn_status(peers, ps);
|
||||
__process_peer_state(peers, ps);
|
||||
|
||||
/* For each remote peers */
|
||||
if (!ps->local) {
|
||||
if (!ps->appctx) {
|
||||
@ -3585,6 +3596,9 @@ static void __process_stopping_peer_sync(struct task *task, struct peers *peers,
|
||||
|
||||
/* For each peer */
|
||||
for (ps = peers->remote; ps; ps = ps->next) {
|
||||
__process_peer_learn_status(peers, ps);
|
||||
__process_peer_state(peers, ps);
|
||||
|
||||
if ((state & TASK_WOKEN_SIGNAL) && !(peers->flags & PEERS_F_DONOTSTOP)) {
|
||||
/* we're killing a connection, we must apply a random delay before
|
||||
* retrying otherwise the other end will do the same and we can loop
|
||||
|
Loading…
Reference in New Issue
Block a user