The event handler emits bogus events

Bug #1463814 reported by Lucian Petrut
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
compute-hyperv
Fix Released
High
Lucian Petrut

Bug Description

The listener currently used by the instance event handler records
all WMI instance object changes, even though we only care about
power state changes.

For this reason, we currently record the last emited power state
change in order to see whether the power state actually changed
before emiting a new change.

This is problematic and unreliable. When the instance is created,
it will be powered off. If anything changes, the current
implementation will emit a power off event, having no previous
recorded state. For this reason, the manager can consider that the
the instance was unexpectedly powered off, calling the stop
API, which is highly undesirable.

This patch fixes the issue by constructing a WQL query used by the
event listener in order to catch events only in case the instance
actually transitioned into one of the states that we're interested
in.

Revision history for this message
Claudiu Belu (cbelu) wrote :
Changed in compute-hyperv:
assignee: nobody → Lucian Petrut (petrutlucian94)
importance: Undecided → High
status: New → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to compute-hyperv (master)

Reviewed: https://review.openstack.org/190158
Committed: https://git.openstack.org/cgit/stackforge/compute-hyperv/commit/?id=490dfdd3167e27a38bb84299bb57350a11d846d4
Submitter: Jenkins
Branch: master

commit 490dfdd3167e27a38bb84299bb57350a11d846d4
Author: Lucian Petrut <email address hidden>
Date: Wed Jun 10 15:03:54 2015 +0300

    Hyper-V: Fix instance event handler

    The listener currently used by the instance event handler records
    all WMI instance object changes, even though we only care about
    power state changes.

    For this reason, we currently record the last emited power state
    change in order to see whether the power state actually changed
    before emiting a new change.

    This is problematic and unreliable. When the instance is created,
    it will be powered off. If anything changes, the current
    implementation will emit a power off event, having no previous
    recorded state. For this reason, the manager can consider that the
    the instance was unexpectedly powered off, calling the stop
    API, which is highly undesirable.

    This patch fixes the issue by constructing a WQL query used by the
    event listener in order to catch events only in case the instance
    actually transitioned into one of the states that we're interested
    in.

    Change-Id: I7efe33d8f4d8df44a09ac3c0ac3e29c2947fe67c
    Closes-Bug: #1463814

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to compute-hyperv (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/190217

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to compute-hyperv (stable/kilo)

Reviewed: https://review.openstack.org/190217
Committed: https://git.openstack.org/cgit/stackforge/compute-hyperv/commit/?id=5249f17e28d879982c4b9bf83f08fa926f390d48
Submitter: Jenkins
Branch: stable/kilo

commit 5249f17e28d879982c4b9bf83f08fa926f390d48
Author: Lucian Petrut <email address hidden>
Date: Wed Jun 10 15:03:54 2015 +0300

    Hyper-V: Fix instance event handler

    The listener currently used by the instance event handler records
    all WMI instance object changes, even though we only care about
    power state changes.

    For this reason, we currently record the last emited power state
    change in order to see whether the power state actually changed
    before emiting a new change.

    This is problematic and unreliable. When the instance is created,
    it will be powered off. If anything changes, the current
    implementation will emit a power off event, having no previous
    recorded state. For this reason, the manager can consider that the
    the instance was unexpectedly powered off, calling the stop
    API, which is highly undesirable.

    This patch fixes the issue by constructing a WQL query used by the
    event listener in order to catch events only in case the instance
    actually transitioned into one of the states that we're interested
    in.

    Change-Id: I7efe33d8f4d8df44a09ac3c0ac3e29c2947fe67c
    Closes-Bug: #1463814
    (cherry picked from commit 490dfdd3167e27a38bb84299bb57350a11d846d4)

tags: added: in-stable-kilo
Claudiu Belu (cbelu)
Changed in compute-hyperv:
status: Fix Committed → Fix Released
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.