Bug 1496517
Summary: | Calling virDomain.getMemoryStats and virDomain.diskErrors may block the entire process | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Nir Soffer <nsoffer> | ||||||
Component: | libvirt-python | Assignee: | Pavel Hrdina <phrdina> | ||||||
Status: | CLOSED ERRATA | QA Contact: | lcheng | ||||||
Severity: | high | Docs Contact: | |||||||
Priority: | high | ||||||||
Version: | 7.4 | CC: | chhu, dyuan, fromani, gveitmic, gwatson, jherrman, jiyan, jsuchane, kchamart, lhuang, lmen, mkalinin, mtessun, pkrempa, weizhan, xuzhang, ykaul | ||||||
Target Milestone: | rc | Keywords: | ZStream | ||||||
Target Release: | 7.5 | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | libvirt-python-3.8.0-1.el7 | Doc Type: | Bug Fix | ||||||
Doc Text: |
When the storage of a guest hosted on a Red Hat Virtualization Hypervisor system became inaccessible, the host in some cases became unresponsive. This update fixes the behavior of the virDomainMemoryStats() function, which prevents the described problem from occurring.
|
Story Points: | --- | ||||||
Clone Of: | |||||||||
: | 1497195 1497197 (view as bug list) | Environment: | |||||||
Last Closed: | 2018-04-10 11:07:31 UTC | Type: | Bug | ||||||
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: | |||||||||
Bug Blocks: | 1481022, 1497195, 1497197 | ||||||||
Attachments: |
|
Description
Nir Soffer
2017-09-27 16:03:46 UTC
Fixed upstream: commit 7af7450b0ac6bd69181f3c8d2360f4f97478191c Author: Nir Soffer <nirsof> Date: Tue Sep 26 20:05:59 2017 +0300 Release the GIL during virDomainGetMemoryStats & virDomainGetDiskErrors We discovered that the entire python process get stuck for about 30 seconds when calling virDomain.getMemoryStats() if libvirt is stuck in virConnect.getAllDomainStats() on inaccessible storage. This blocking cause a horrible mess in oVirt. This patches adds the standard *_ALLOW_THREADS around the call to avoid this unwanted blocking. According to bug 1497197 comment 5, I can reproduce this bug on libvirt-python-3.7.0-1.el7.x86_64. Reproduce steps: 1. prepare a image on nfs server and boot guest using this image in xml. 2. on console 1, run # python ./test.py 3. wait about 30-40s, on console 2 run # iptables -A OUTPUT -d [NFS_SERVER] -j DROP For several min, the output for print will hang for 30s. Test log as follows: ***************** 44:print time: 2017-10-24 06:39:54.356051 45:print time: 2017-10-24 06:39:55.357165 start getAllDomainStats: 2017-10-24 06:39:55.557711 46:print time: 2017-10-24 06:39:56.358309 47:print time: 2017-10-24 06:39:57.359428 start memoryStats: 2017-10-24 06:39:58.356300 <--------------- here the time libvirt: QEMU Driver error : Timed out during operation: cannot acquire state change lock (held by remoteDispatchConnectGetAllDomainStats) 48:print time: 2017-10-24 06:40:28.357638 Exception in thread Thread-2: Traceback (most recent call last): File "/usr/lib64/python2.7/threading.py", line 812, in __bootstrap_inner self.run() File "/usr/lib64/python2.7/threading.py", line 765, in run self.__target(*self.__args, **self.__kwargs) File "./test.py", line 19, in memory_stats dom.memoryStats() File "/usr/lib64/python2.7/site-packages/libvirt.py", line 1504, in memoryStats if ret is None: raise libvirtError ('virDomainMemoryStats() failed', dom=self) libvirtError: Timed out during operation: cannot acquire state change lock (held by remoteDispatchConnectGetAllDomainStats) 49:print time: 2017-10-24 06:40:29.358779 <----------------- here the time 50:print time: 2017-10-24 06:40:30.359898 51:print time: 2017-10-24 06:40:31.361016 ************** Verify on libvirt-python-3.8.0-1.el7.x86_64. The print will finished without hang, so move to VERIFIED. Created attachment 1342692 [details]
test scripts
Created attachment 1342693 [details]
test xml
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. https://access.redhat.com/errata/RHEA-2018:0707 |