Fix timeout on systems with large numbers of loops #872
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On systems with a very large number of snap packages installed (for example), there are a considerable number of loop devices. In this case, the
lsblk
command inlinuxdrivelist
fills the stdout pipe, blocks, and the rpi-imager process assumes it has timed out 1.This PR is a trivial work-around that simply excludes loop devices (major=7) from the
lsblk
output. Given subsequent code 2 excludes everything starting with/dev/loop
anyway, there should be no change in user experience with this exclusion other than rpi-imager not failing on such systems (with a very large number of loop devices).However, it may be preferable to fix the call to
lsblk
so that it doesn't (potentially) block the main UI thread for up to two seconds and die when thelsblk
output is sufficiently large to block the pipe (i.e. have it loop onQProcess.waitForReadyRead
instead of just blocking onQProcess.waitForFinished
). If this is preferred, I'm happy to submit a PR for that instead.