You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.2 KiB

  1. From 22e0a2295a96c30c9cd11e3aa5997e9de9083b93 Mon Sep 17 00:00:00 2001
  2. From: William Lallemand <wlallemand@haproxy.com>
  3. Date: Fri, 23 Dec 2016 15:44:15 +0100
  4. Subject: [PATCH 17/19] BUG/MINOR: systemd: potential zombie processes
  5. In systemd mode (-Ds), the master haproxy process is waiting for each
  6. child to exit in a specific order. If a process die when it's not his
  7. turn, it will become a zombie process until every processes exit.
  8. The master is now waiting for any process to exit in any order.
  9. This patch should be backported to 1.7, 1.6 and 1.5.
  10. (cherry picked from commit 1e4fc43630eb194f8e8dd98197cf47c7e9912371)
  11. ---
  12. src/haproxy.c | 2 +-
  13. 1 file changed, 1 insertion(+), 1 deletion(-)
  14. diff --git a/src/haproxy.c b/src/haproxy.c
  15. index c31ccb0..b30a351 100644
  16. --- a/src/haproxy.c
  17. +++ b/src/haproxy.c
  18. @@ -2038,7 +2038,7 @@ int main(int argc, char **argv)
  19. /* it's OK because "-Ds -f x" is the shortest form going here */
  20. memcpy(argv[0] + strlen(argv[0]), "-master", 8);
  21. for (proc = 0; proc < global.nbproc; proc++)
  22. - while (waitpid(children[proc], NULL, 0) == -1 && errno == EINTR);
  23. + while (waitpid(-1, NULL, 0) == -1 && errno == EINTR);
  24. }
  25. exit(0); /* parent must leave */
  26. }
  27. --
  28. 2.10.2