Bug 639405 - Interrupted cached appliance creation leaves libguestfs unusable
Interrupted cached appliance creation leaves libguestfs unusable
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Richard W.M. Jones
Depends On:
  Show dependency treegraph
Reported: 2010-10-01 12:36 EDT by Matthew Booth
Modified: 2011-07-15 05:55 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2011-07-15 05:55:37 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Matthew Booth 2010-10-01 12:36:39 EDT
Description of problem:
* A user interrupts guestfs_launch() with Ctrl-C while
  febootstrap-supermin-helper is in the process of creating a new cached appliance
* The cache now contains a corrupt appliance
* The user runs guestfs_launch() again some time later.
* libguestfs doesn't detect the corrupt appliance and fails to launch.

The only way to recover from this situation is for the user to manually delete the cache directory.

Suggested pseudo code:

check for /tmp/<checksum>
if it exists, use it

create /tmp/<checksum>.XXXXXX
create appliance in temp directory
rename /tmp/<checksum>.XXXXXX to /tmp/<checksum>

if rename failed, check for existence of /tmp/<checksum> (again)
if it exists, use it
exit with an error about rename

This would have the added advantage of fixing a race condition where 2 instances of libguestfs are simultaneously creating a new appliance cache for the same user.

Version-Release number of selected component (if applicable):
Comment 1 Richard W.M. Jones 2010-10-28 15:42:40 EDT
Your fix has been included in libguestfs 1.5.25:
and in febootstrap 2.10:

Can you confirm that these completely fix the problem as
described above?
Comment 2 Richard W.M. Jones 2011-07-14 15:17:25 EDT
Comment 3 Matthew Booth 2011-07-15 04:53:08 EDT
Yes, it fixed the above problem.
Comment 4 Richard W.M. Jones 2011-07-15 05:55:37 EDT
Thanks!  Closing as per comment 3.

Note You need to log in before you can comment on or make changes to this bug.