mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-14 19:09:11 +02:00
MINOR: server/event_hdl: add support for SERVER_UP and SERVER_DOWN events
We're using srv_update_status() as the only event source or UP/DOWN server events in an attempt to simplify the support for these 2 events. It seems srv_update_status() is the common path for server state changes anyway Tested with server state updated from various sources: - the cli - server-state file (maybe we could disable this or at least don't publish in global event queue in the future if it ends in slower startup for setups relying on huge server state files) - dns records (ie: srv template) (again, could be fined tuned to only publish in server specific subscriber list and no longer in global subscription list if mass dns update tend to slow down srv_update_status()) - normal checks and observe checks (HCHK_STATUS_HANA) (same as above, if checks related state update storms are expected) - lua scripts - html stats page (admin mode)
This commit is contained in:
committed by
Christopher Faulet
parent
129ecf441f
commit
22f82f81e5
@@ -239,6 +239,8 @@ struct event_hdl_sub {
|
||||
#define EVENT_HDL_SUB_SERVER EVENT_HDL_SUB_FAMILY(1)
|
||||
#define EVENT_HDL_SUB_SERVER_ADD EVENT_HDL_SUB_TYPE(1,1)
|
||||
#define EVENT_HDL_SUB_SERVER_DEL EVENT_HDL_SUB_TYPE(1,2)
|
||||
#define EVENT_HDL_SUB_SERVER_UP EVENT_HDL_SUB_TYPE(1,3)
|
||||
#define EVENT_HDL_SUB_SERVER_DOWN EVENT_HDL_SUB_TYPE(1,4)
|
||||
|
||||
/* --------------------------------------- */
|
||||
|
||||
|
||||
@@ -441,6 +441,7 @@ struct event_hdl_cb_data_server {
|
||||
struct server *ptr; /* server live ptr */
|
||||
/* lock hints */
|
||||
uint8_t thread_isolate; /* 1 = thread_isolate is on, no locking required */
|
||||
uint8_t srv_lock; /* 1 = srv lock is held */
|
||||
} unsafe;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user