Bug 790958
Summary: | multiprovider build error: RuntimeError: link: /tmp/.guestfs-0/kernel /tmp/.guestfs-0/kernel.10139: File exists | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Richard W.M. Jones <rjones> |
Component: | libguestfs | Assignee: | Richard W.M. Jones <rjones> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.3 | CC: | akarol, brad, dajohnso, ddumas, deltacloud-maint, dgao, hbrock, leiwang, mbooth, moli, qguan, qwan, rjones, ssachdev, virt-maint, whayutin, yuzhou |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libguestfs-1.16.6-1.el6 | Doc Type: | Bug Fix |
Doc Text: |
Cause:
libguestfs appliance building was not thread-safe when two threads *in the same program* called 'guestfs_launch' at the same time. (Note this didn't affect multiple processes using libguestfs, only multiple threads in the same process)
Consequence:
Multi-threaded programs using multiple libguestfs handles would rarely give unexpected errors.
Fix:
libguestfs appliance building and 'guestfs_launch' is now thread safe.
Result:
libguestfs can be used from multi-threaded programs with more than one libguestfs handle.
|
Story Points: | --- |
Clone Of: | 790721 | Environment: | |
Last Closed: | 2012-06-20 07:00:35 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 790721 | ||
Bug Blocks: | 790528 |
Description
Richard W.M. Jones
2012-02-15 19:35:52 UTC
Upstream commit is https://github.com/libguestfs/libguestfs/commit/afed7e493dcd594620f19b93e9fb73e58553f60a Requesting 6.2.z as this is a blocker for Cloudforms. Per Hugh, imcleod did a workaround for 6.2 in Factory. Removing zstream request, fix will hit just 6.3. Reproduced on libguestfs-1.16.5-1.el6.x86_64 and verified on libguestfs-1.16.12-1.el6.x86_64. Reproduce steps: excuet reproducer like following: #cat test.py #!/usr/bin/python import os import threading import guestfs def factory(): g = guestfs.GuestFS() g.set_qemu("/bin/true") g.add_drive("/dev/null") g.launch() g.sync() g.umount_all() def main(): threads = [] for thread_is in range(0,20): threads.append(threading.Thread(target=factory)) for thread in threads: thread.start() for thread in threads: thread.join() if __name__ == "__main__": main() # python test.py Get error like following: Exception in thread Thread-18: Traceback (most recent call last): File "/usr/lib64/python2.6/threading.py", line 532, in __bootstrap_inner self.run() File "/usr/lib64/python2.6/threading.py", line 484, in run self.__target(*self.__args, **self.__kwargs) File "test.py", line 10, in factory g.launch() File "/usr/lib/python2.6/site-packages/guestfs.py", line 244, in launch return libguestfsmod.launch (self._o) RuntimeError: link: /var/tmp/.guestfs-0/root /var/tmp/.guestfs-0/root.7816: File exists Verify Step: [root@localhost ~]# python test.py Only get errors like following, no File exists errors. Exception in thread Thread-3: Traceback (most recent call last): File "/usr/lib64/python2.6/threading.py", line 532, in __bootstrap_inner self.run() File "/usr/lib64/python2.6/threading.py", line 484, in run self.__target(*self.__args, **self.__kwargs) File "test.py", line 10, in factory g.launch() File "/usr/lib/python2.6/site-packages/guestfs.py", line 244, in launch return libguestfsmod.launch (self._o) RuntimeError: child process died unexpectedly According to test result above, change this bug into VERIFIED. Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Cause: libguestfs appliance building was not thread-safe when two threads *in the same program* called 'guestfs_launch' at the same time. (Note this didn't affect multiple processes using libguestfs, only multiple threads in the same process) Consequence: Multi-threaded programs using multiple libguestfs handles would rarely give unexpected errors. Fix: libguestfs appliance building and 'guestfs_launch' is now thread safe. Result: libguestfs can be used from multi-threaded programs with more than one libguestfs handle. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2012-0774.html |