[Bug 1403137] [NEW] service keepalived reload leaks file descriptors

Therese McHale 1403137 at bugs.launchpad.net
Tue Dec 16 16:59:30 UTC 2014


Public bug reported:

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 2.1.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();

** Affects: keepalived (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to keepalived in Ubuntu.
https://bugs.launchpad.net/bugs/1403137

Title:
  service keepalived reload leaks file descriptors

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/keepalived/+bug/1403137/+subscriptions



More information about the Ubuntu-server-bugs mailing list