[PATCH python] Release the GIL during virDomainGetMemoryStats

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Signed-off-by: Nir Soffer <nirsof@xxxxxxxxx>
---
 libvirt-override.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libvirt-override.c b/libvirt-override.c
index 9eba4ed..0e33afb 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -363,8 +363,11 @@ libvirt_virDomainMemoryStats(PyObject *self ATTRIBUTE_UNUSED,
         return NULL;
     domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain);
 
+    LIBVIRT_BEGIN_ALLOW_THREADS;
     nr_stats = virDomainMemoryStats(domain, stats,
                                     VIR_DOMAIN_MEMORY_STAT_NR, 0);
+    LIBVIRT_END_ALLOW_THREADS;
+
     if (nr_stats == -1)
         return VIR_PY_NONE;
 
-- 
2.9.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux