[master] 0cf47b5ac Reduce close-margin over highest known filedescriptor.

Poul-Henning Kamp phk at FreeBSD.org
Wed Feb 6 14:04:09 UTC 2019


commit 0cf47b5acbc42eba48b262fc3c4070c406970d30
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Feb 6 13:57:45 2019 +0000

    Reduce close-margin over highest known filedescriptor.
    
    Fixes: #2844

diff --git a/bin/varnishd/mgt/mgt_child.c b/bin/varnishd/mgt/mgt_child.c
index e6fd7c514..92a6313ca 100644
--- a/bin/varnishd/mgt/mgt_child.c
+++ b/bin/varnishd/mgt/mgt_child.c
@@ -180,18 +180,16 @@ mch_cli_panic_clear(struct cli *cli, const char * const *av, void *priv)
  *
  * This is likely to a bit on the low side, as libc and other libraries
  * has a tendency to cache file descriptors (syslog, resolver, etc.)
- * so we add a margin of 100 fds.
+ * so we add a margin of 10 fds.
  *
- * for added safety, we check that we see no file descriptor open for
+ * For added safety, we check that we see no file descriptor open for
  * another margin above the limit for which we close by design
  */
 
 static int		mgt_max_fd;
 
-#define CLOSE_FD_UP_TO	(mgt_max_fd + 100)
-// XXX should work now - engage?
-//#define CLOSE_FD_UP_TO	mgt_max_fd
-#define CHECK_FD_UP_TO	(CLOSE_FD_UP_TO + 100)
+#define CLOSE_FD_UP_TO	(mgt_max_fd + 10)
+#define CHECK_FD_UP_TO	(CLOSE_FD_UP_TO + 10)
 
 void
 MCH_TrackHighFd(int fd)


More information about the varnish-commit mailing list