Package: keepalived
Version: 1:1.2.13-1
Severity: wishlist
Tags: patch

When keepalived is reloaded using service keepalived reload (on controller 
nodes) it leaks file descriptors.

Steps to reproduce:

1. Locate the vrrp keepalived process

$ ps -elf |grep -i keepalived
1 S root 15129 1 0 80 0 - 12884 poll_s 16:47 ? 00:00:00 /usr/sbin/keepalived
5 S root 15132 15129 0 80 0 - 12990 poll_s 16:47 ? 00:00:00 /usr/sbin/keepalived
5 S root 15133 15129 0 80 0 - 12990 poll_s 16:47 ? 00:00:00 /usr/sbin/keepalived

The vrrp process is usually the second process above i.e. 15132.

2. Count how many files it has open:
$ sudo lsof -p 15132 |wc -l
34

3. Reload keepalived
$ sudo service keepalived reload
[ ok ] Reloading keepalived configuration.......

4. Count again

$ sudo lsof -p 15132 |wc -l
35

I have tested with 1.2.14 of keepalived the problem is still there.
The healthcheck daemon does a kernel_netlink_init and the cmd socket isn't 
closed on reload but
a new one is opened.

I can fix with this diff, but don't know if this is the correct way to do this:

— keepalived-1.2.14/keepalived/check/check_daemon.c 2014-05-12 
08:11:27.000000000 +0100
+++ keepalived-1.2.14.patched/keepalived/check/check_daemon.c 2014-12-16 
15:50:20.342064582 +0000
@@ -71,6 +71,7 @@ stop_check(void)
free_check_data(check_data);
#ifdef WITH_VRRP
free_interface_queue();
+ kernel_netlink_close();
#endif

#ifdef DEBUG
@@ -196,6 +197,7 @@ reload_check_thread(thread_t * thread)
free_checkers_queue();
#ifdef WITH_VRRP
free_interface_queue();
+ stop_check();
#endif
free_ssl();
ipvs_stop();

Thank you for considering this patch,
Heather

--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to