Re: [PATCH python] Release the GIL during virDomainGetMemoryStats

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

 



On Wed, Sep 27, 2017 at 6:05 PM Daniel P. Berrange <berrange@xxxxxxxxxx> wrote:
On Tue, Sep 26, 2017 at 08:05:59PM +0300, Nir Soffer wrote:
> 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;

Reviewed-by: Daniel P. Berrange <berrange@xxxxxxxxxx>

I'll squash in the same fix for virDomainGetDiskErrors too

Cool, thanks!
 

Regards,
Daniel
--
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
--
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