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

NAS-129045 / 24.10 / Improve disk.get_partitions_quick #13744

Merged
merged 5 commits into from
May 16, 2024

Conversation

yocalebo
Copy link
Contributor

As pointed out in recent PR: #13738, device.settle_udev_events is needed (sporadically) after partitioning disks. The reason why is that certain operations will generate udev events. We try to access the information before those events have been processed and so sysfs information will not be complete.

The problem by calling settle_udev_events is that it will tell udev to drain the entire event queue. The queue holds information for ALL hardware and related events. This means, depending on what the system is doing at the time this is called, it can block and wait for 120 seconds (default timeout).

This PR changes it so that disk.get_partitions_quick actually tries 10 times (maximum) for the sysfs files to be generated. While I'm here, I noticed that if a disk had > 9 partitions, this would not return correct information. To be fair, however, we don't have any logic to handle disks with that many partitions but I went ahead and fixed this while I was here.

@yocalebo yocalebo requested a review from a team May 16, 2024 17:19
@yocalebo yocalebo added the jira label May 16, 2024
@bugclerk bugclerk changed the title Improve disk.get_partitions_quick NAS-129045 / 24.10 / Improve disk.get_partitions_quick May 16, 2024
@bugclerk
Copy link
Contributor

@truenas truenas deleted a comment from bugclerk May 16, 2024
@yocalebo yocalebo requested a review from bmeagherix May 16, 2024 18:37
@yocalebo yocalebo merged commit 5855253 into master May 16, 2024
2 of 3 checks passed
@yocalebo yocalebo deleted the improve-get_partitions_quick branch May 16, 2024 18:38
@bugclerk
Copy link
Contributor

This PR has been merged and conversations have been locked.
If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

@truenas truenas locked as resolved and limited conversation to collaborators May 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants