service keepalived reload leaks file descriptors

Bug #1403137 reported by Therese McHale
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
keepalived (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

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

Revision history for this message
Bryan Quigley (bryanquigley) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. The issue you are reporting is an upstream one and it would be nice if somebody having it could send the bug to the developers of the software at http://www.keepalived.org.

I see in the latest changelog: http://www.keepalived.org/changelog.html
"Properly close netlink channel to avoid fd leak." - so maybe it's already fixed?

If not, and you report a bug upstream please do let us know here. Thanks!

Changed in keepalived (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for keepalived (Ubuntu) because there has been no activity for 60 days.]

Changed in keepalived (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.