mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 22:01:31 +02:00
MINOR: server/event_hdl: prepare for upcoming refactors
This commit does nothing that ought to be mentioned, except that it adds missing comments and slighty moves some function calls out of "sensitive" code in preparation of some server code refactors.
This commit is contained in:
parent
2f6a07dce8
commit
a63f4903c9
@ -420,6 +420,8 @@ struct server {
|
|||||||
struct event_hdl_cb_data_server {
|
struct event_hdl_cb_data_server {
|
||||||
/* provided by:
|
/* provided by:
|
||||||
* EVENT_HDL_SUB_SERVER_ADD
|
* EVENT_HDL_SUB_SERVER_ADD
|
||||||
|
* EVENT_HDL_SUB_SERVER_DEL
|
||||||
|
* EVENT_HDL_SUB_SERVER_UP
|
||||||
* EVENT_HDL_SUB_SERVER_DOWN
|
* EVENT_HDL_SUB_SERVER_DOWN
|
||||||
*/
|
*/
|
||||||
struct {
|
struct {
|
||||||
|
18
src/server.c
18
src/server.c
@ -5301,9 +5301,6 @@ static void srv_update_status(struct server *s)
|
|||||||
s->next_admin = s->cur_admin;
|
s->next_admin = s->cur_admin;
|
||||||
|
|
||||||
if ((s->cur_state != SRV_ST_STOPPED) && (s->next_state == SRV_ST_STOPPED)) {
|
if ((s->cur_state != SRV_ST_STOPPED) && (s->next_state == SRV_ST_STOPPED)) {
|
||||||
/* no maintenance + server DOWN: publish event SERVER DOWN */
|
|
||||||
srv_event_hdl_publish(EVENT_HDL_SUB_SERVER_DOWN, s, 0);
|
|
||||||
|
|
||||||
s->last_change = now.tv_sec;
|
s->last_change = now.tv_sec;
|
||||||
if (s->proxy->lbprm.set_server_status_down)
|
if (s->proxy->lbprm.set_server_status_down)
|
||||||
s->proxy->lbprm.set_server_status_down(s);
|
s->proxy->lbprm.set_server_status_down(s);
|
||||||
@ -5317,6 +5314,9 @@ static void srv_update_status(struct server *s)
|
|||||||
*/
|
*/
|
||||||
xferred = pendconn_redistribute(s);
|
xferred = pendconn_redistribute(s);
|
||||||
|
|
||||||
|
/* no maintenance + server DOWN: publish event SERVER DOWN */
|
||||||
|
srv_event_hdl_publish(EVENT_HDL_SUB_SERVER_DOWN, s, 0);
|
||||||
|
|
||||||
tmptrash = alloc_trash_chunk();
|
tmptrash = alloc_trash_chunk();
|
||||||
if (tmptrash) {
|
if (tmptrash) {
|
||||||
chunk_printf(tmptrash,
|
chunk_printf(tmptrash,
|
||||||
@ -5371,9 +5371,6 @@ static void srv_update_status(struct server *s)
|
|||||||
}
|
}
|
||||||
else if (((s->cur_state != SRV_ST_RUNNING) && (s->next_state == SRV_ST_RUNNING))
|
else if (((s->cur_state != SRV_ST_RUNNING) && (s->next_state == SRV_ST_RUNNING))
|
||||||
|| ((s->cur_state != SRV_ST_STARTING) && (s->next_state == SRV_ST_STARTING))) {
|
|| ((s->cur_state != SRV_ST_STARTING) && (s->next_state == SRV_ST_STARTING))) {
|
||||||
/* no maintenance + server going UP: publish event SERVER UP */
|
|
||||||
srv_event_hdl_publish(EVENT_HDL_SUB_SERVER_UP, s, 0);
|
|
||||||
|
|
||||||
if (s->proxy->srv_bck == 0 && s->proxy->srv_act == 0) {
|
if (s->proxy->srv_bck == 0 && s->proxy->srv_act == 0) {
|
||||||
if (s->proxy->last_change < now.tv_sec) // ignore negative times
|
if (s->proxy->last_change < now.tv_sec) // ignore negative times
|
||||||
s->proxy->down_time += now.tv_sec - s->proxy->last_change;
|
s->proxy->down_time += now.tv_sec - s->proxy->last_change;
|
||||||
@ -5414,6 +5411,9 @@ static void srv_update_status(struct server *s)
|
|||||||
*/
|
*/
|
||||||
xferred = pendconn_grab_from_px(s);
|
xferred = pendconn_grab_from_px(s);
|
||||||
|
|
||||||
|
/* no maintenance + server going UP: publish event SERVER UP */
|
||||||
|
srv_event_hdl_publish(EVENT_HDL_SUB_SERVER_UP, s, 0);
|
||||||
|
|
||||||
tmptrash = alloc_trash_chunk();
|
tmptrash = alloc_trash_chunk();
|
||||||
if (tmptrash) {
|
if (tmptrash) {
|
||||||
chunk_printf(tmptrash,
|
chunk_printf(tmptrash,
|
||||||
@ -5500,9 +5500,6 @@ static void srv_update_status(struct server *s)
|
|||||||
if (s->onmarkeddown & HANA_ONMARKEDDOWN_SHUTDOWNSESSIONS)
|
if (s->onmarkeddown & HANA_ONMARKEDDOWN_SHUTDOWNSESSIONS)
|
||||||
srv_shutdown_streams(s, SF_ERR_DOWN);
|
srv_shutdown_streams(s, SF_ERR_DOWN);
|
||||||
|
|
||||||
/* maintenance on previously running server: publish event SERVER DOWN */
|
|
||||||
srv_event_hdl_publish(EVENT_HDL_SUB_SERVER_DOWN, s, 0);
|
|
||||||
|
|
||||||
/* force connection cleanup on the given server */
|
/* force connection cleanup on the given server */
|
||||||
srv_cleanup_connections(s);
|
srv_cleanup_connections(s);
|
||||||
/* we might have streams queued on this server and waiting for
|
/* we might have streams queued on this server and waiting for
|
||||||
@ -5511,6 +5508,9 @@ static void srv_update_status(struct server *s)
|
|||||||
*/
|
*/
|
||||||
xferred = pendconn_redistribute(s);
|
xferred = pendconn_redistribute(s);
|
||||||
|
|
||||||
|
/* maintenance on previously running server: publish event SERVER DOWN */
|
||||||
|
srv_event_hdl_publish(EVENT_HDL_SUB_SERVER_DOWN, s, 0);
|
||||||
|
|
||||||
tmptrash = alloc_trash_chunk();
|
tmptrash = alloc_trash_chunk();
|
||||||
if (tmptrash) {
|
if (tmptrash) {
|
||||||
chunk_printf(tmptrash,
|
chunk_printf(tmptrash,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user