mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-21 05:06:56 +00:00
MAJOR: servers: propagate server status changes asynchronously.
In order to prepare multi-thread development, code was re-worked to propagate changes asynchronoulsy. Servers with pending status changes are registered in a list and this one is processed and emptied only once 'run poll' loop. Operational status changes are performed before administrative status changes. In a case of multiple operational status change or admin status change in the same 'run poll' loop iteration, those changes are merged to reach only the targeted status.
This commit is contained in:
parent
d716f9bacf
commit
64cc49cf7e
@ -50,6 +50,9 @@ void srv_compute_all_admin_states(struct proxy *px);
|
||||
int srv_set_addr_via_libc(struct server *srv, int *err_code);
|
||||
int srv_init_addr(void);
|
||||
struct server *cli_find_server(struct appctx *appctx, char *arg);
|
||||
void servers_update_status(void);
|
||||
|
||||
extern struct list updated_servers;
|
||||
|
||||
/* functions related to server name resolution */
|
||||
int snr_update_srv_status(struct server *s, int has_no_ip);
|
||||
|
@ -299,6 +299,9 @@ struct server {
|
||||
int nb_high;
|
||||
} tmpl_info;
|
||||
struct dns_srvrq *srvrq; /* Pointer representing the DNS SRV requeest, if any */
|
||||
struct list update_status; /* to attach to list of servers chnaging status */
|
||||
char op_st_chg_reason[48]; /* operational status change's reason */
|
||||
char adm_st_chg_cause[48]; /* adminstrative status change's cause */
|
||||
};
|
||||
|
||||
/* Descriptor for a "server" keyword. The ->parse() function returns 0 in case of
|
||||
|
@ -2182,6 +2182,9 @@ static void run_poll_loop()
|
||||
cur_poller.poll(&cur_poller, next);
|
||||
fd_process_cached_events();
|
||||
applet_run_active();
|
||||
|
||||
/* Commit server status changes */
|
||||
servers_update_status();
|
||||
}
|
||||
}
|
||||
|
||||
|
933
src/server.c
933
src/server.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user