]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mworker: don't poll on LI_O_INHERITED listeners
authorWilliam Lallemand <wlallemand@haproxy.com>
Fri, 12 Oct 2018 08:39:54 +0000 (10:39 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 12 Oct 2018 17:30:18 +0000 (19:30 +0200)
The listeners with the LI_O_INHERITED flag were deleted but not unbound
which is a problem since we have a polling in the master.

This patch unbind every listeners which are not require for the master,
but does not close the FD of those that have a LI_O_INHERITED flag.

src/haproxy.c

index a7b07a267581ad4a0dba9997aba19774f463de4d..82da86222cf066e6a2bb54391f46618b6370717a 100644 (file)
@@ -615,13 +615,17 @@ static void mworker_cleanlisteners()
 
        for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
                list_for_each_entry_safe(l, l_next, &curproxy->conf.listeners, by_fe) {
-                       /* does not close if the FD is inherited with fd@
-                        * from the parent process */
-                       if (!(l->options & (LI_O_INHERITED|LI_O_MWORKER)))
-                               unbind_listener(l);
                        /* remove the listener, but not those we need in the master... */
-                       if (!(l->options & LI_O_MWORKER))
+                       if (!(l->options & LI_O_MWORKER)) {
+                               /* unbind the listener but does not close if
+                                  the FD is inherited with fd@ from the parent
+                                  process */
+                               if (l->options & LI_O_INHERITED)
+                                       unbind_listener_no_close(l);
+                               else
+                                       unbind_listener(l);
                                delete_listener(l);
+                       }
                }
        }
 }