Bug 945601 - wicked always waits full timeout for non-existing [hotplug] devices
wicked always waits full timeout for non-existing [hotplug] devices
Status: RESOLVED WONTFIX
Classification: openSUSE
Product: openSUSE Distribution
Classification: openSUSE
Component: Network
13.2
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: wicked maintainers
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-13 16:11 UTC by Hans-Peter Jansen
Modified: 2018-04-12 14:06 UTC (History)
4 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
boot log (20.05 KB, text/x-log)
2015-09-13 16:11 UTC, Hans-Peter Jansen
Details
wicked logging (11.39 KB, application/x-xz)
2015-09-16 08:46 UTC, Hans-Peter Jansen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hans-Peter Jansen 2015-09-13 16:11:12 UTC
Created attachment 647081 [details]
boot log

Using this trivial interface setup, wicked always delays boot for > 30 seconds:

BOOTPROTO='dhcp4'
BROADCAST=''
DHCLIENT_SET_DEFAULT_ROUTE='yes'
ETHTOOL_OPTIONS=''
IPADDR=''
MTU=''
NAME='Intel Ethernet controller'
NETMASK=''
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='auto'

The only special thing is setting additional routes via dhcpd, since wicked lost this option itself (#907495).

This issue happens with the updated wicked package, as well as the one from network:wicked:master, which is, what I use now. 

Kernel is 4.1.6 (from factory)
Comment 1 Pawel Wieczorkiewicz 2015-09-15 09:04:56 UTC
Please provide more logs as per description here:
https://en.opensuse.org/openSUSE:Bugreport_wicked

Thanks.
Comment 2 Hans-Peter Jansen 2015-09-16 08:46:25 UTC
Created attachment 647437 [details]
wicked logging
Comment 3 Hans-Peter Jansen 2015-09-16 08:49:57 UTC
Dear Pawel,

wicked logging attached. Most interesting part:

2015-09-16T10:31:12.033579+02:00 xrated wickedd-nanny[1193]: waiting for 0 devices to become ready (0 explicitly requested)
2015-09-16T10:31:34.151449+02:00 xrated wicked[1195]: Interface wait time reached

Ahh, waiting for _zero_ devices to become ready, wasting 22 secs on every boot!
Comment 4 Pawel Wieczorkiewicz 2015-09-16 08:59:49 UTC
(In reply to Hans-Peter Jansen from comment #3)
> Dear Pawel,
> 
> wicked logging attached. Most interesting part:
> 
> 2015-09-16T10:31:12.033579+02:00 xrated wickedd-nanny[1193]: waiting for 0
> devices to become ready (0 explicitly requested)
> 2015-09-16T10:31:34.151449+02:00 xrated wicked[1195]: Interface wait time
> reached
> 
> Ahh, waiting for _zero_ devices to become ready, wasting 22 secs on every
> boot!

You conclusion is incorrect. The wickedd-nanny is a daemon whose task is to wait for some event. The above printout says that it's done with all requested devices, so it does not wait for any of those, it waits for new requests.
This has nothing to do with what wicked client above prints out.

From the log you attached I see:
2015-09-16T10:31:34.161612+02:00 xrated wicked[1195]: Exit with status: 0
2015-09-16T10:31:34.161878+02:00 xrated wicked[1195]: lo              up
2015-09-16T10:31:34.162118+02:00 xrated wicked[1195]: eth0            up
2015-09-16T10:31:34.162334+02:00 xrated wicked[1195]: enp0s20u2       no-device
2015-09-16T10:31:34.162531+02:00 xrated wicked[1195]: enp0s20u1       no-device

Wicked is requested to configure all the devices listed above and some of them are missing. Wicked waits up to WAIT_FOR_INTERFACES value (default: 30s) from /etc/sysconfig/network/config file for them to appear and gives up after that time.
Unfortunately you did not provide all logs I requested, however I assume there are ifcfg-enp0s20u1 and ifcfg-enp0s20u2 file in /etc/sysconfig/network/ directory for devices that might not show up.
Comment 5 Hans-Peter Jansen 2015-09-16 13:08:17 UTC
Those are related to an usb device, that I use occasionally. 

Interestingly, it is related to the same device, but that's a YaST problem, of course. Will reduce WAIT_FOR_INTERFACES value, and see, where it gets.
Comment 6 Marius Tomaschewski 2015-09-22 08:18:16 UTC
There are the following configs:

2015-09-16T10:31:04.147086+02:00 xrated wicked[1195]: ni_sysconfig_read(/etc/sysconfig/network/ifcfg-enp0s20u2)
2015-09-16T10:31:04.147172+02:00 xrated wicked[1195]: ni_sysconfig_read(/etc/sysconfig/network/ifcfg-eth0)
2015-09-16T10:31:04.147270+02:00 xrated wicked[1195]: ni_sysconfig_read(/etc/sysconfig/network/ifcfg-enp0s20u1)
2015-09-16T10:31:04.147360+02:00 xrated wicked[1195]: ni_sysconfig_read(/etc/sysconfig/network/ifcfg-lo)

which are added to nanny:

2015-09-16T10:31:04.148803+02:00 xrated wicked[1195]: enp0s20u1: adding policy policy__enp0s20u1 to nanny
2015-09-16T10:31:04.152173+02:00 xrated wicked[1195]: enp0s20u2: adding policy policy__enp0s20u2 to nanny
2015-09-16T10:31:04.154749+02:00 xrated wicked[1195]: eth0: adding policy policy__eth0 to nanny
2015-09-16T10:31:04.157317+02:00 xrated wicked[1195]: lo: adding policy policy__lo to nanny

nanny finished it's steps on (lo and) eth0:

2015-09-16T10:31:12.033392+02:00 xrated wickedd-nanny[1193]: eth0: successfully transitioned from addrconf-up to network-up

and there is nothing it could currently do with the another devices,
which aren't available:

2015-09-16T10:31:12.033579+02:00 xrated wickedd-nanny[1193]: waiting for 0 devices to become ready (0 explicitly requested)

but wicked ifup still waits for the missed enp0s20u1 and enp0s20u2
to appear until the end of ifup --timeout:

2015-09-16T10:31:34.151449+02:00 xrated wicked[1195]: Interface wait time reached

Whether to wait or not depends on the configuration:
   BOOTPROTO=auto/[on]boot/nfsroot => always wait
vs.
   BOOTPROTO=hotplug & co => wait only if device exists

This is not catched properly in ifup.

Bug description "wicked always take > 30sec for usual dhcp setup" is simply wrong -- regardless of the above behavior :-)
Comment 7 Marius Tomaschewski 2015-09-22 08:31:41 UTC
(In reply to Marius Tomaschewski from comment #6)
> Whether to wait or not depends on the configuration:
>    BOOTPROTO=auto/[on]boot/nfsroot => always wait
> vs.
>    BOOTPROTO=hotplug & co => wait only if device exists

Sorry, BOOTPROTO is completely wrong :-/ Correct is:

Whether to wait or not depends on the configuration:
    STARTMODE=auto/[on]boot/nfsroot => always wait
 vs.
    STARTMODE=hotplug & co => wait only if device exists
Comment 8 Hans-Peter Jansen 2015-09-22 10:20:39 UTC
Marius, you nailed it, thank you.

Since I fetch from network:wicked:master, let me know, if there's something to test (given, that this repo will receive related changes).

Meanwhile, reducing WAIT_FOR_INTERFACES had the expected behavior, and my boot time is fine again..
Comment 9 Pawel Wieczorkiewicz 2016-01-18 16:08:54 UTC
Solution under review:
https://github.com/openSUSE/wicked/pull/620
Comment 10 Tomáš Chvátal 2018-04-12 14:06:37 UTC
This version of openSUSE changed to end-of-life (EOL [1]) status. As such
it is no longer maintained, which means that it will not receive any
further security or bug fix updates.
As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
openSUSE, or consider the bug still valid, please feel free to reopen this
bug against that version, or open a new ticket.

Thank you for reporting this bug and we are sorry it could not be fixed
during the lifetime of the release.

[1] https://en.opensuse.org/Lifetime