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 1670490 - Exception being dropped when adding a disk or a logical volume
Summary: Exception being dropped when adding a disk or a logical volume
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: tuned
Version: 7.6
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Jaroslav Škarvada
QA Contact: Robin Hack
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-29 16:33 UTC by Renaud Métrich
Modified: 2020-10-12 15:04 UTC (History)
5 users (show)

Fixed In Version: tuned-2.11.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-06 13:04:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 4309631 0 None None None 2020-10-12 15:04:48 UTC
Red Hat Product Errata RHBA-2019:2201 0 None None None 2019-08-06 13:05:18 UTC

Description Renaud Métrich 2019-01-29 16:33:54 UTC
Description of problem:

When adding a disk to the system or creating a logical volume, an exception is dropped as shown below:

-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
2019-01-29 17:18:33,003 INFO     tuned.plugins.hotplug: device 'dm-2' added
2019-01-29 17:18:33,004 INFO     tuned.plugins.hotplug: instance disk: adding new device dm-2
2019-01-29 17:18:33,004 ERROR    tuned.hardware.inventory: Exception occured in event handler of '<tuned.plugins.plugin_disk.DiskPlugin object at 0x7ff560840c50>'.
2019-01-29 17:18:33,004 ERROR    tuned.hardware.inventory: 
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/tuned/hardware/inventory.py", line 58, in _handle_udev_event
    callback(event, device)
  File "/usr/lib/python2.7/site-packages/tuned/plugins/plugin_disk.py", line 54, in _hardware_events_callback
    super(DiskPlugin, self)._hardware_events_callback(event, device)
  File "/usr/lib/python2.7/site-packages/tuned/plugins/hotplug.py", line 29, in _hardware_events_callback
    self._add_device(device)
  File "/usr/lib/python2.7/site-packages/tuned/plugins/hotplug.py", line 46, in _add_device
    self._added_device_apply_tuning(instance, device_name)
  File "/usr/lib/python2.7/site-packages/tuned/plugins/plugin_disk.py", line 58, in _added_device_apply_tuning
    instance._load_monitor.add_device(device_name)
  File "/usr/lib/python2.7/site-packages/tuned/monitors/base.py", line 102, in add_device
    assert isinstance(device, str)
AssertionError
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------


Version-Release number of selected component (if applicable):

tuned-2.10.0-6.el7.noarch


How reproducible:

Always


Steps to Reproduce:
1. Add a disk to a VM through hotplugging it or create a logical volume

  # vgcreate vg1 /dev/sdb
  # lvcreate -n vol1 -L 1G vg1


Actual results:

Exception above


Expected results:

No exception and device properly configured by tuned


Additional info:

Instrumenting the code, it appears that the device coming from udev is seen as "unicode" string, which can be seen by adding the log.info() line below:

/usr/lib/python2.7/site-packages/tuned/plugins/hotplug.py:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
        def _add_device(self, device):
                device_name = device.sys_name
                log.info("DEVICE TYPE: %s" % type(device_name))
...
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

We then get the following log when creating a logical volume:

-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
2019-01-29 17:27:37,269 INFO     tuned.plugins.hotplug: device 'dm-3' added
2019-01-29 17:27:37,269 INFO     tuned.plugins.hotplug: DEVICE TYPE: <type 'unicode'>
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Later, because of the following line, the assertion fails:

/usr/lib/python2.7/site-packages/tuned/monitors/base.py:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
        def add_device(self, device):
                assert isinstance(device, str)
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

device.sys_name can probably be converted into a "str", but I'm not completely sure about that:

-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
        def _add_device(self, device):
                device_name = str(device.sys_name)
...
        def _remove_device(self, device):
                device_name = str(device.sys_name)
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Comment 2 Renaud Métrich 2019-01-29 16:39:03 UTC
Doesn't happen with RHEL8 tuned-2.10.0-14.el8.noarch, although code is similar.
Looks like the hotplug code is not called somehow.

Comment 3 Ondřej Lysoněk 2019-01-29 17:01:10 UTC
We're aware of the problem, hotplug is broken. The following commit should fix it:
https://github.com/redhat-performance/tuned/pull/141/commits/941fc6e2ea165a34c7db2949869c597e8c216357

Comment 8 errata-xmlrpc 2019-08-06 13:04:46 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://access.redhat.com/errata/RHBA-2019:2201


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