Skip to content
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

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

yarda
Copy link
Contributor

@yarda yarda commented May 30, 2024

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.

@yarda yarda requested a review from zacikpa July 22, 2024 16:10
Copy link
Contributor

@zacikpa zacikpa left a 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:

@@ -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))
Copy link
Contributor

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.

Suggested change
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))

Copy link
Contributor Author

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]>
@yarda
Copy link
Contributor Author

yarda commented Jul 23, 2024

Centos 7 CI failure is caused by dropped EPEL-7, it's being worked on.

@yarda yarda merged commit b2adce8 into redhat-performance:master Jul 23, 2024
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants