]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: proxy: make soft_stop() also close FDs in LI_PAUSED state
authorWilly Tarreau <w@1wt.eu>
Tue, 10 Dec 2019 06:11:35 +0000 (07:11 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 10 Dec 2019 09:43:31 +0000 (10:43 +0100)
The proxies' soft_stop() function closes the FDs in all opened states
except LI_PAUSED. This means that a transient error on a listener might
cause it to turn back to the READY state if it happens exactly when a
reload signal is received.

This must be backported to all supported versions.

src/proxy.c

index ebc6415bd4c587cd3f20e664b9129dc0ee30dcbb..1724766234ce7dbc23c090c474bd2f97104cc3af 100644 (file)
@@ -1134,10 +1134,10 @@ void soft_stop(void)
                if (p->state == PR_STSTOPPED &&
                    !LIST_ISEMPTY(&p->conf.listeners) &&
                    LIST_ELEM(p->conf.listeners.n,
-                   struct listener *, by_fe)->state >= LI_ZOMBIE) {
+                   struct listener *, by_fe)->state > LI_ASSIGNED) {
                        struct listener *l;
                        list_for_each_entry(l, &p->conf.listeners, by_fe) {
-                               if (l->state >= LI_ZOMBIE)
+                               if (l->state > LI_ASSIGNED)
                                        close(l->fd);
                                l->state = LI_INIT;
                        }