service keepalived reload leaks file descriptors
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/
5 S root 15132 15129 0 80 0 - 12990 poll_s 16:47 ? 00:00:00 /usr/sbin/
5 S root 15133 15129 0 80 0 - 12990 poll_s 16:47 ? 00:00:00 /usr/sbin/
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-
+++ keepalived-
@@ -71,6 +71,7 @@ stop_check(void)
free_check_
#ifdef WITH_VRRP
free_interface_
+ kernel_
#endif
#ifdef DEBUG
@@ -196,6 +197,7 @@ reload_
free_checkers_
#ifdef WITH_VRRP
free_interface_
+ stop_check();
#endif
free_ssl();
ipvs_stop();
Changed in keepalived (Ubuntu): | |
status: | New → Incomplete |
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!