-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hotplug: wait for device initialization #637
Conversation
4d5bdd8
to
e93c17c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me, but I did no thorough testing. Just one nit:
tuned/hardware/inventory.py
Outdated
@@ -54,6 +54,14 @@ def _handle_udev_event(self, event, device): | |||
if not device.subsystem in self._subscriptions: | |||
return | |||
|
|||
retry = consts.HOTPLUG_WAIT_FOR_DEV_INIT_RETRIES | |||
while not device.is_initialized and retry > 0: | |||
log.debug("Device '%s' is uninitialized, waiting '%d' seconds for its initialization." % (device, consts.HOTPLUG_WAIT_FOR_DEV_INIT_DELAY)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe print this as float, the current log would just say 0 seconds in the default configuration.
log.debug("Device '%s' is uninitialized, waiting '%d' seconds for its initialization." % (device, consts.HOTPLUG_WAIT_FOR_DEV_INIT_DELAY)) | |
log.debug("Device '%s' is uninitialized, waiting '%.2f' seconds for its initialization." % (device, consts.HOTPLUG_WAIT_FOR_DEV_INIT_DELAY)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed.
Resolves: RHEL-39468 Signed-off-by: Jaroslav Škarvada <[email protected]>
e93c17c
to
27349f8
Compare
Centos 7 CI failure is caused by dropped EPEL-7, it's being worked on. |
This is the first shot trying to resolve the potential problem with hotplug. It needs thorough testing. I am not sure whether it's a good thing to use it also for the remove events, maybe it would require refactor.