*/
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();
if (tmptrash) {
chunk_printf(tmptrash,
*/
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();
if (tmptrash) {
chunk_printf(tmptrash,
*/
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();
if (tmptrash) {
chunk_printf(tmptrash,
}
- /* ignore if server stays down when leaving maintenance mode */
- if (s->next_state != SRV_ST_STOPPED) {
- /* leaving maintenance + server UP: publish event SERVER UP */
- srv_event_hdl_publish(EVENT_HDL_SUB_SERVER_UP, s, 0);
- }
-
tmptrash = alloc_trash_chunk();
if (tmptrash) {
if (!(s->next_admin & SRV_ADMF_FMAINT) && (s->cur_admin & SRV_ADMF_FMAINT)) {
/* server was down and no longer is */
if (s->last_change < ns_to_sec(now_ns)) // ignore negative times
s->down_time += ns_to_sec(now_ns) - s->last_change;
+ _srv_event_hdl_publish(EVENT_HDL_SUB_SERVER_UP, cb_data.common, s);
}
else if (s->cur_state == SRV_ST_STOPPED) {
/* server was up and is currently down */
s->counters.down_trans++;
+ _srv_event_hdl_publish(EVENT_HDL_SUB_SERVER_DOWN, cb_data.common, s);
}
s->last_change = ns_to_sec(now_ns);