clear-holder fails reading missing dir in sysfs during tear-down
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
curtin |
In Progress
|
Medium
|
Unassigned |
Bug Description
During vmtest runs, when tearing down layered bcache devices, we encounter a race condition when looking for block device holders. Curtin issues various shutdown commands to bcache layers and when the kernel stops and removes the device, the sysfs path to the 'holders' subdir is no longer valid.
This list comprehension of collecting paths from an os.listdir() on a non-existent sysfspath throws an OSError.
Traceback (most recent call last):
File "/curtin/
ret = args.func(args)
File "/curtin/
meta_
File "/curtin/
clear_
File "/curtin/
for holders_tree in [gen_holders_
File "/curtin/
for holders_tree in [gen_holders_
File "/curtin/
'holders': [gen_holders_
File "/curtin/
'holders': [gen_holders_
File "/curtin/
holder_paths = ([block.
File "/curtin/
holders = os.listdir(
The fix here is to:
1) log the error
2) if the exception is an OSError (filenotfound) then we'll ignore it as the device was expected to be deleted.
Changed in curtin: | |
importance: | Undecided → Medium |
status: | New → In Progress |