Description of problem: udevadm-settle doesn't calculate timeout even if a value is provided. Looking at the code, we see that udevadm-settle uses timeout value only for pinging udev process when running as root, but it is not related to waiting until the udev event queue is empty. Version-Release number of selected component (if applicable): How reproducible: Constantly. Steps to Reproduce: Write a program that invokes udevadm-settle with timeout. Run the program *not* under root. Actual results: Program will not return even when timeout is reached. Expected results: Program to return once timeout is reached. Additional info: If already making changes in this area, it would be good to return a specific return value timeout occurs. This way the caller could figure out that timeout occurred.
The timeout implementation was removed in: commit 9ea28c55a2488e6cd4a44ac5786f12b71ad5bc9f Author: Kay Sievers <kay> Date: Sat Apr 12 22:35:50 2014 -0700 udev: remove seqnum API and all assumptions about seqnums The way the kernel namespaces have been implemented breaks assumptions udev made regarding uevent sequence numbers. Creating devices in a namespace "steals" uevents and its sequence numbers from the host. It confuses the "udevadmin settle" logic, which might block until util a timeout is reached, even when no uevent is pending. Remove any assumptions about sequence numbers and deprecate libudev's API exposing these numbers; none of that can reliably be used anymore when namespaces are involved.
Created attachment 1011987 [details] Patch fixing this issue
Fixed in upstream by: commit 0736455b1186c9515e0f093e1e686e684d225787 Author: Nir Soffer <nirsof> Date: Wed Apr 8 04:04:16 2015 +0300 udev: restore udevadm settle timeout Commit 9ea28c55a2 (udev: remove seqnum API and all assumptions about seqnums) introduced a regresion, ignoring the timeout option when waiting until the event queue is empty. Previously, if the udev event queue was not empty when the timeout was expired, udevadm settle was returning with exit code 1. To check if the queue is empty, you could invoke udevadm settle with timeout=0. This patch restores the previous behavior. (David: fixed timeout==0 handling and dropped redundant assignment) We need a backport for Fedora 21.
But this fix is partial - when timeout is 0, the timeout is still ignored. See bug 1210981.
Marking as post, so we can remember to backport this.
This message is a reminder that Fedora 21 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 21. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '21'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 21 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 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 Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.