RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1210981 - udevadm settle ignores the timeout when --timeout=0
Summary: udevadm settle ignores the timeout when --timeout=0
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: systemd-maint
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-11 20:10 UTC by Nir Soffer
Modified: 2015-11-19 15:00 UTC (History)
7 users (show)

Fixed In Version: systemd-219-2.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 15:00:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2092 0 normal SHIPPED_LIVE systemd bug fix and enhancement update 2015-11-19 12:13:57 UTC

Description Nir Soffer 2015-04-11 20:10:56 UTC
Description of problem:

When running udevadm settle with zero timeout, it should check if the
event queue is empty and return immediately.

udevadm(8) says:

    ...
    udevadm settle [options]
       Watches the udev event queue, and exits if all current events are
       handled.

       --timeout=seconds
           Maximum number of seconds to wait for the event queue to become
           empty. The default value is 120 seconds. A value of 0 will check
           if the queue is empty and always return immediately.
    ...

Version-Release number of selected component (if applicable):
rhel >= 7

How reproducible:
Always

Steps to Reproduce:
1. Ensure that the event queue is not empty
2. udevadm settle --timeout=0

Actual results:
Waits until the event queue is empty - as if called without the
--timeout argument.

Expected results:
If the event queue is empty, should return immediately

Additional info:

In rhel 6 (udev-147) udevadm behaved according to the manual.

The behavior changed in:

commit ead7c62ab7641e150c6d668f939c102a6771ce60
Author: Kay Sievers <kay.sievers>
Date:   Wed Apr 20 02:18:22 2011 +0200

    udevadm: settle - kill alarm()

Looking at the patch, the behavior change seems to be unintended.

Comment 1 Nir Soffer 2015-04-11 20:12:17 UTC
Addding Regression - behavior changed since RHEL 6.

Comment 5 Allon Mureinik 2015-04-28 07:52:02 UTC
(In reply to Nir Soffer from comment #1)
> Addding Regression - behavior changed since RHEL 6.
As this is a regression, it would be nice to also have a fix for RHEL 7.1.z.
Bronce - could you please raise the correct flag for this - I do not have the permissions.

Comment 6 Nir Soffer 2015-04-28 11:51:15 UTC
Fixed in:

commit bf23b9f86f6807c3029a6a46e1999ae0c87ca22a
Author: Nir Soffer <nirsof>
Date:   Sun Apr 19 03:41:26 2015 +0300

    udev: settle should return immediately when timeout is 0
    
    udevadm manual says:
    
        A value of 0 will check if the queue is empty and always return
        immediately.
    
    However, currently we ignore the deadline if the value is 0, and wait
    without any limit.
    
    Zero timeout behaved according to the documentation until commit
    ead7c62ab7 (udevadm: settle - kill alarm()). Looking at this patch, it
    seems that the behavior change was unintended.
    
    This patch restores the documented behavior.

Comment 7 Bronce McClain 2015-05-11 15:26:30 UTC
(In reply to Allon Mureinik from comment #5)
> (In reply to Nir Soffer from comment #1)
> > Addding Regression - behavior changed since RHEL 6.
> As this is a regression, it would be nice to also have a fix for RHEL 7.1.z.
> Bronce - could you please raise the correct flag for this - I do not have
> the permissions.
7.1.z? added

Comment 9 Michal Sekletar 2015-05-13 14:39:57 UTC
To test the backport in the VM one might follow instructions bellow,



#!/bin/bash

# export NAME and MAJOR MINOR numbers for partition where /boot is
export $(lsblk -P | awk '{ if ($0 ~ /MOUNTPOINT="\/boot"/) { split($1,name,"="); gsub("\"", "", name[2]); split($2,nums,"="); gsub("\"","",nums[2]); split(nums[2],res,":"); printf "NAME=%s MAJOR=%s MINOR=%s\n", name[2], res[1], res[2]; } }')

# write the test rule 
printf "ACTION==\"add\", ENV{MAJOR}==\"$MAJOR\", ENV{MINOR}==\"$MINOR\", RUN+=\"/bin/sleep 7200\"\n" > /etc/udev/rules.d/99-test.rules

# reload rules
udevadm control --reload

# syntetize udev add event for the device
echo "add" > /sys$(udevadm info --query=path --name=$NAME)/uevent

# check if event is still being processed
udevadm settle --timeout 0 >/dev/null 2>&1

[[ $? == 0 ]] && echo 'FAILED' || echo 'PASS'

Comment 12 errata-xmlrpc 2015-11-19 15:00:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2092.html


Note You need to log in before you can comment on or make changes to this bug.