Memory leak when using the old WMI

Bug #1697389 reported by Alin Balutoiu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
os-win
Won't Fix
Undecided
Unassigned

Bug Description

The Msvm_VirtualSystemManagementService WMI object is cached at the os-win level for performance reasons: https://github.com/openstack/os-win/blob/stable/ocata/os_win/utils/baseutils.py#L92-L97

It has been noticed that when the AddResourceSettings and ModifyResourceSettings are called on the previous object will leak the WMI objects passed as parameter to the mentioned functions. This will cause the Nova Python process to continue to eat more and more memory. It seems that the Python garbage collector is not able to free the respective memory until the cached object Msvm_VirtualSystemManagementService reference is deleted.

This issue does not affect if the PyMI module is being used. The old WMI is being used only on Windows Server 2012 for some operations where PyMI is not available. On Windows Server 2012r2 and Windows Server 2016 only PyMI is being used.

Claudiu Belu (cbelu)
Changed in os-win:
status: New → Won't Fix
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-win (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/475590

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-win (stable/ocata)

Reviewed: https://review.openstack.org/475590
Committed: https://git.openstack.org/cgit/openstack/os-win/commit/?id=938a99a7a7b1f55b7e31f0ff028d4f72ee0e2cdb
Submitter: Jenkins
Branch: stable/ocata

commit 938a99a7a7b1f55b7e31f0ff028d4f72ee0e2cdb
Author: Claudiu Belu <email address hidden>
Date: Tue Jun 13 16:07:58 2017 +0300

    Fixes cached old WMI service objects issue

    When using WMI, the resources passed to the
    Msvm_VirtualSystemManagementService are not cleaned up
    by the garbage collector if the Service object is still
    referenced (cached as a property in BaseUtilsVirt).

    PyMI doesn't have this issue, so the Service objects can be
    safely cached.

    This issue only affects Windows / Hyper-V Server 2012.

    Conflicts:
            os_win/tests/unit/utils/compute/test_migrationutils.py

    Closes-Bug: #1697389
    (cherry picked from commit 49a012e83c44d28ee533aace22c42b1781b8e5e2)

    tests: Sets baseutils.BaseUtilsVirt._old_wmi

    There is a race condition between tests, and because
    the _old_wmi is not set, it will try to load it, but since it
    is mocked, it cannot, and it shouldn't.

    Change-Id: Id029baf2e72f7b67eb6af3b3e66f998b902fd412

    Change-Id: If8df0bf0a2f13a9e94993dde8b2a18943f2e9f83

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/os-win 1.4.2

This issue was fixed in the openstack/os-win 1.4.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/os-win 2.1.0

This issue was fixed in the openstack/os-win 2.1.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.