Bug 639405 - Interrupted cached appliance creation leaves libguestfs unusable
Summary: Interrupted cached appliance creation leaves libguestfs unusable
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-10-01 16:36 UTC by Matthew Booth
Modified: 2011-07-15 09:55 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-07-15 09:55:37 UTC
Embargoed:


Attachments (Terms of Use)

Description Matthew Booth 2010-10-01 16:36:39 UTC
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):
1.5.20

Comment 1 Richard W.M. Jones 2010-10-28 19:42:40 UTC
Your fix has been included in libguestfs 1.5.25:
http://git.annexia.org/?p=libguestfs.git;a=shortlog;h=1.5.25
and in febootstrap 2.10:
http://git.annexia.org/?p=febootstrap.git;a=shortlog;h=2.10

Can you confirm that these completely fix the problem as
described above?

Comment 2 Richard W.M. Jones 2011-07-14 19:17:25 UTC
Ping?

Comment 3 Matthew Booth 2011-07-15 08:53:08 UTC
Yes, it fixed the above problem.

Comment 4 Richard W.M. Jones 2011-07-15 09:55:37 UTC
Thanks!  Closing as per comment 3.


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