Bug 1670490
| Summary: | Exception being dropped when adding a disk or a logical volume | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Renaud Métrich <rmetrich> |
| Component: | tuned | Assignee: | Jaroslav Škarvada <jskarvad> |
| Status: | CLOSED ERRATA | QA Contact: | Robin Hack <rhack> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 7.6 | CC: | jeder, jserrano, jskarvad, olysonek, rhack |
| Target Milestone: | rc | Keywords: | Patch, Upstream |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | tuned-2.11.0-1.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2019-08-06 13:04:46 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
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. 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 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 |
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< --------