diff --git a/doc/internals/listener-states.fig b/doc/internals/listener-states.fig index 4738901bb..5635c7bc3 100644 --- a/doc/internals/listener-states.fig +++ b/doc/internals/listener-states.fig @@ -1,4 +1,4 @@ -#FIG 3.2 Produced by xfig version 2.2 +#FIG 3.2 Produced by xfig version 3.2.7b Portrait Center Metric @@ -12,31 +12,14 @@ Single 0 34 #56c5ff 0 35 #55d941 0 36 #f8e010 -6 3105 1305 4185 1845 -1 1 0 3 0 7 51 -1 20 0.000 1 0.0000 3645 1575 495 225 3645 1575 4140 1575 -4 1 0 50 -1 18 10 0.0000 4 120 555 3645 1575 LISTEN\001 -4 1 1 50 -1 16 10 0.0000 4 120 90 3645 1755 5\001 --6 -6 2160 2205 3240 2745 -1 1 0 3 0 7 51 -1 20 0.000 1 0.0000 2700 2475 495 225 2700 2475 3195 2475 -4 1 0 50 -1 18 10 0.0000 4 120 630 2700 2475 LIMITED\001 -4 1 1 50 -1 16 10 0.0000 4 120 90 2700 2655 8\001 --6 -6 2160 3195 3240 3735 -1 1 0 3 0 7 51 -1 20 0.000 1 0.0000 2700 3471 495 225 2700 3471 3195 3471 -4 1 0 50 -1 18 10 0.0000 4 120 630 2700 3465 PAUSED\001 -4 1 1 50 -1 16 10 0.0000 4 120 90 2700 3645 3\001 --6 -6 3960 2205 5040 2745 -1 1 0 3 0 7 51 -1 20 0.000 1 0.0000 4500 2475 495 225 4500 2475 4995 2475 -4 1 0 50 -1 18 10 0.0000 4 120 375 4500 2475 FULL\001 -4 1 1 50 -1 16 10 0.0000 4 120 90 4500 2655 7\001 --6 1 1 0 3 0 7 51 -1 20 0.000 1 0.0000 900 450 495 225 900 450 1395 450 1 1 0 3 0 7 51 -1 20 0.000 1 0.0000 2700 450 495 225 2700 450 3195 450 1 1 0 3 0 7 51 -1 20 0.000 1 0.0000 4500 450 495 225 4500 450 4995 450 -1 1 0 3 0 7 51 -1 20 0.000 1 0.0000 900 1305 495 225 900 1305 1395 1305 1 1 0 3 0 7 51 -1 20 0.000 1 0.0000 900 3465 495 225 900 3465 1395 3465 +1 1 0 3 0 7 51 -1 20 0.000 1 0.0000 2700 2475 495 225 2700 2475 3195 2475 +1 1 0 3 0 7 51 -1 20 0.000 1 0.0000 3645 1575 495 225 3645 1575 4140 1575 +1 1 0 3 0 7 51 -1 20 0.000 1 0.0000 4500 2475 495 225 4500 2475 4995 2475 +1 1 0 3 0 7 51 -1 20 0.000 1 0.0000 2700 3471 495 225 2700 3471 3195 3471 2 1 1 3 1 7 52 -1 -1 8.000 1 0 -1 0 0 2 270 1980 5355 1350 2 2 0 2 32 32 52 -1 20 0.000 1 0 -1 0 0 5 @@ -45,8 +28,6 @@ Single 2070 990 5130 990 5130 2880 2070 2880 2070 990 2 2 0 2 35 35 52 -1 20 0.000 1 0 -1 0 0 5 270 90 5130 90 5130 855 270 855 270 90 -2 2 0 2 34 34 52 -1 20 0.000 1 0 -1 0 0 5 - 270 990 1530 990 1530 1665 270 1665 270 990 2 2 0 2 36 36 52 -1 20 0.000 1 0 -1 0 0 5 270 3060 1530 3060 1530 3870 270 3870 270 3060 3 0 0 3 0 7 50 -1 -1 0.000 0 1 0 2 @@ -65,10 +46,6 @@ Single 1 1 1.00 60.00 120.00 3195 3510 3600 3465 4140 2655 0.000 1.000 0.000 -3 0 0 3 0 7 50 -1 -1 0.000 0 1 0 3 - 1 1 1.00 60.00 120.00 - 3195 1485 2970 1305 1350 1305 - 0.000 1.000 0.000 3 0 0 3 0 7 50 -1 -1 0.000 0 1 0 3 1 1 1.00 60.00 120.00 4410 2250 4365 2070 4050 1710 @@ -138,12 +115,9 @@ Single 4 0 1 51 -1 16 7 1.5708 4 105 600 5355 1260 transitions\001 4 2 1 51 -1 16 7 1.5708 4 105 795 5265 1485 multi-threaded\001 4 0 1 51 -1 16 7 1.5708 4 120 870 5265 1260 single-threaded\001 -4 1 0 50 -1 18 10 0.0000 4 120 615 900 1305 ZOMBIE\001 -4 1 1 50 -1 16 10 0.0000 4 120 90 900 1485 4\001 4 0 0 52 -1 17 7 0.0000 4 90 345 315 765 no FD\001 4 0 0 52 -1 17 7 0.0000 4 135 315 315 3825 polled\001 4 1 0 50 -1 18 10 0.0000 4 120 555 900 3465 READY\001 -4 1 1 50 -1 16 10 0.0000 4 120 90 900 3645 6\001 4 0 0 50 -1 16 7 0.0000 4 120 255 1170 3825 full()\001 4 2 0 50 -1 16 7 0.0000 4 90 540 2205 3375 !maxconn\001 4 2 0 50 -1 16 7 0.0000 4 105 675 2295 3240 resume() &&\001 @@ -164,6 +138,13 @@ Single 4 1 0 50 -1 16 7 0.0000 4 120 330 3555 405 .add()\001 4 0 0 50 -1 16 7 0.0000 4 120 375 4545 810 .bind()\001 4 0 0 52 -1 17 7 0.0000 4 135 1080 2115 1125 FD ready, not polled\001 -4 0 0 52 -1 17 7 0.0000 4 135 420 315 1620 stopped\001 4 0 0 50 -1 16 7 0.0000 4 120 315 1305 3240 limit()\001 -4 2 0 50 -1 16 7 0.0000 4 120 930 3060 1530 zombify_proxy()\001 +4 1 0 50 -1 18 10 0.0000 4 120 630 2700 2475 LIMITED\001 +4 1 0 50 -1 18 10 0.0000 4 120 555 3645 1575 LISTEN\001 +4 1 0 50 -1 18 10 0.0000 4 120 375 4500 2475 FULL\001 +4 1 0 50 -1 18 10 0.0000 4 120 630 2700 3465 PAUSED\001 +4 1 1 50 -1 16 10 0.0000 4 120 90 2700 3645 3\001 +4 1 1 50 -1 16 10 0.0000 4 120 90 2700 2655 7\001 +4 1 1 50 -1 16 10 0.0000 4 120 90 4500 2655 6\001 +4 1 1 50 -1 16 10 0.0000 4 120 90 900 3645 5\001 +4 1 1 50 -1 16 10 0.0000 4 120 90 3645 1755 4\001 diff --git a/doc/internals/listener-states.png b/doc/internals/listener-states.png index 15e65dd5f..8757a1280 100644 Binary files a/doc/internals/listener-states.png and b/doc/internals/listener-states.png differ diff --git a/include/haproxy/listener-t.h b/include/haproxy/listener-t.h index 0af6353a8..15328f479 100644 --- a/include/haproxy/listener-t.h +++ b/include/haproxy/listener-t.h @@ -50,7 +50,6 @@ enum li_state { LI_INIT, /* all parameters filled in, but not assigned yet */ LI_ASSIGNED, /* assigned to the protocol, but not listening yet */ LI_PAUSED, /* listener was paused, it's bound but not listening */ - LI_ZOMBIE, /* The listener doesn't belong to the process, but is kept opened */ LI_LISTEN, /* started, listening but not enabled */ LI_READY, /* started, listening and enabled */ LI_FULL, /* reached its connection limit */ diff --git a/include/haproxy/listener.h b/include/haproxy/listener.h index 726931624..68020c36d 100644 --- a/include/haproxy/listener.h +++ b/include/haproxy/listener.h @@ -165,8 +165,8 @@ static inline struct bind_conf *bind_conf_alloc(struct proxy *fe, const char *fi static inline const char *listener_state_str(const struct listener *l) { - static const char *states[9] = { - "NEW", "INI", "ASS", "PAU", "ZOM", "LIS", "RDY", "FUL", "LIM", + static const char *states[8] = { + "NEW", "INI", "ASS", "PAU", "LIS", "RDY", "FUL", "LIM", }; unsigned int st = l->state; diff --git a/src/listener.c b/src/listener.c index 8f54ae206..f6ab73c50 100644 --- a/src/listener.c +++ b/src/listener.c @@ -287,9 +287,6 @@ int pause_listener(struct listener *l) HA_SPIN_LOCK(LISTENER_LOCK, &l->lock); - if (l->state <= LI_ZOMBIE) - goto end; - if ((global.mode & (MODE_DAEMON | MODE_MWORKER)) && !(proc_mask(l->rx.settings->bind_proc) & pid_bit)) goto end; @@ -359,7 +356,7 @@ int resume_listener(struct listener *l) } } - if (l->state < LI_PAUSED || l->state == LI_ZOMBIE) { + if (l->state < LI_PAUSED) { ret = 0; goto end; } diff --git a/src/proxy.c b/src/proxy.c index eeb492e53..e23268d98 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -1354,7 +1354,6 @@ void zombify_proxy(struct proxy *p) * Pretend we're still up and running so that the fd * will be sent if asked. */ - l->state = LI_ZOMBIE; if (!first_to_listen && oldstate >= LI_LISTEN) first_to_listen = l; }