Kea leaks file descriptors when performing a reload
name: Kea leaks file descriptors when performing a reload
about: This can be problematic for some scripts
Describe the bug
If you perform a reload by systemd or calling an API call, it will leak. We noticed this issue when we had a really bad script to perform reload pretty often. This obviously hit a default limit of open file descriptors per process (1024), which resulted in constant log spam and crash.
To Reproduce
Steps to reproduce the behavior:
- Get the current amount of file descriptors for Kea DHCPv4/v6/CA PID. You can use a script provided below.
for i in $(ps -C "${SEARCH}" -o pid | grep -v PID)
do
echo "$(ls -l /proc/${i}/fd | wc -l)"
done
and then run: SEARCH=kea-dhcp4 ./script.sh
this will give me a value 49
for example
- Perform a reload by an API call or
systemctl reload isc-kea-dhcp4-server
- Run the script again:
SEARCH=kea-dhcp4 ./script.sh
- Value changes from
49
to52
This also happens for other Kea services like Control Agent.
Expected behavior
It shouldn't leak, the number of file descriptors should be lower or stay the same.
Environment:
- Kea version: 2.6.0 (can be reproduced on older versions)
- OS: Debian 12
- Kea hooks: HA, MySQL, stat_cmds, lease_cmds, perfmon
Edited by Vojtěch Dočkal