Bug 84661

Summary: systemd-networkd: FD leak on DHCP renewal
Product: systemd Reporter: lev <lev.cohan>
Component: generalAssignee: Tom Gundersen <teg>
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: systemd-networkd debug log

Description lev 2014-10-04 13:34:34 UTC
Created attachment 107321 [details]
systemd-networkd debug log

Since my last systemd upgrade (215 -> 216) networkd is having timeouts when renewing my dhcp lease.

This happens every two days. The log output is at every incident the same.

Log extract:
Oct 02 09:40:51 G550 systemd-networkd[179]: Failed to save lease data /run/systemd/netif/leases/4: Too many open files
Oct 02 09:40:51 G550 systemd-networkd[179]: extern0 : Failed to save link data to /run/systemd/netif/links/4: Too many open files
Oct 02 09:44:15 G550 systemd[1]: systemd-networkd.service watchdog timeout (limit 1min)!
Oct 02 09:44:15 G550 systemd[1]: Unit systemd-networkd.service entered failed state.
Oct 02 09:44:15 G550 systemd-networkd[18244]: extern0 : gained carrier

config file:
[ext0.network]
[Match]
Name=extern0

[Network]
DHCP=yes

Two days ago I restarted systemd-networkd with
File: /etc/systemd/system/systemd-networkd.service.d/debug.conf
[Service]
Environment=SYSTEMD_LOG_LEVEL=debug

The log is added to this bug report. I only edited the addresses for reasons of secrecy.
Comment 1 lev 2014-10-04 13:36:55 UTC
My bug report on archlinux:
https://bugs.archlinux.org/task/42214
Comment 2 Tomasz Torcz 2014-10-22 14:05:03 UTC
It happens on Fedora v216, too:

systemd-networkd[933]: enp5s0          : lost carrier
systemd-networkd[933]: enp5s0          : DHCP lease lost
systemd-networkd[933]: enp5s0          : gained carrier
systemd-networkd[933]: enp4s0          : gained carrier
systemd-networkd[933]: enp5s0          : DHCPv4 address 185.6.29.55/24 via 185.6.29.1
systemd-networkd[933]: Failed to save Too many open files
systemd-networkd[933]: enp5s0          : Failed to save link data to /run/systemd/netif/links/3: Too many open files
=systemd-networkd[933]: enp4s0          : lost carrier
systemd-networkd[933]: enp4s0          : gained carrier
systemd-networkd[933]: enp5s0          : lost carrier
systemd-networkd[933]: enp5s0          : DHCP lease lost
systemd-networkd[933]: enp5s0          : gained carrier
systemd-networkd[933]: enp5s0          : DHCP error: client failed: Too many open files
systemd-networkd[933]: enp5s0          : DHCP error: client failed: Too many open files

 
 lsof output - 1024 fds used.

systemd-n 933 systemd-network 1015u     IPv4            4243274      0t0     UDP 185.6.29.55:bootpc
systemd-n 933 systemd-network 1016u     pack            4252816      0t0      IP type=SOCK_DGRAM
systemd-n 933 systemd-network 1017u     pack            4262044      0t0      IP type=SOCK_DGRAM
systemd-n 933 systemd-network 1018u     IPv4            4252197      0t0     UDP 185.6.29.55:bootpc
systemd-n 933 systemd-network 1019u     IPv4            4254523      0t0     UDP 185.6.29.55:bootpc
systemd-n 933 systemd-network 1020u     pack            4263385      0t0      IP type=SOCK_DGRAM
systemd-n 933 systemd-network 1022u     IPv4            4264996      0t0     UDP 185.6.29.55:bootpc
systemd-n 933 systemd-network 1023u     raw6                         0t0 4270185 00000000000000000000000000000000:003A->00000000000000000000000000000000:0000 st=07
Comment 3 Tom Gundersen 2014-10-30 22:14:35 UTC
This should now be fixed in git. Please reopen if you can still reproduce the problem.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.