host.py assertion error during NOVA handling of HUP signal

Bug #1599688 reported by Xuanzhou Perry Dong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Xuanzhou Perry Dong

Bug Description

Description
===========
During handling of HUP signal in nova, the following exception is generated:

2016-07-07 01:36:18.012 DEBUG nova.virt.libvirt.host [-] Starting green dispatch thread from (pid=30178) _init_events /op
t/stack/nova/nova/virt/libvirt/host.py:341
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/eventlet/hubs/poll.py", line 115, in wait
    listener.cb(fileno)
  File "/usr/local/lib/python2.7/dist-packages/eventlet/greenthread.py", line 214, in main
    result = function(*args, **kwargs)
  File "/opt/stack/nova/nova/utils.py", line 1053, in context_wrapper
    return func(*args, **kwargs)
  File "/opt/stack/nova/nova/virt/libvirt/host.py", line 131, in _dispatch_thread
    self._dispatch_events()
  File "/opt/stack/nova/nova/virt/libvirt/host.py", line 236, in _dispatch_events
    assert _c
AssertionError

Steps to reproduce
==================
1. Start a devstack with latest master branch.

2. Devstack doesn't start the nova-compute with daemon. So kill the nova-compute started by devstack and replace it with "nohup /usr/local/bin/nova-compute --config-file /etc/nova/nova.conf &"

3. Send a HUP signal to nova-compute process.

Expected result
===============
Expect the nova-compute reloads the configuration file and no exception is generated.

Actual result
=============
An exception is generated.

Environment
===========
1. Nova version:

vagrant@vagrant-ubuntu-trusty-64:/opt/stack/nova/nova$ git log -1
commit 2d5460d085895a577734547660a8bcfc53b04de2
Merge: 51fdeaf 40ea165
Author: Jenkins <email address hidden>
Date: Wed Jun 22 06:18:23 2016 +0000

    Merge "Publish proxy APIs deprecation in api ref doc"

Logs & Configs
==============
As above.

Changed in nova:
assignee: nobody → Xuanzhou Perry Dong (oss-xzdong)
importance: Undecided → Medium
status: New → Confirmed
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/339341

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/339341
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=3a1ca56487c567ca5cd3d0206707465e0fa01e18
Submitter: Jenkins
Branch: master

commit 3a1ca56487c567ca5cd3d0206707465e0fa01e18
Author: Xuanzhou Perry Dong <oss_xzdong@163.com>
Date: Fri Jul 8 12:01:31 2016 +0800

    Avoid multiple initializations of Host class

    nova.virt.libvirt.host.Host class manages nova interaction with
    libvirtd. During processing of HUP signal, object of this class
    could be initialized multiple times. This leads to resource leak
    (pipes and threads) and the following exception:

    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/eventlet/hubs/poll.py",
    line 115, in wait
        listener.cb(fileno)
      File "/usr/local/lib/python2.7/dist-packages/eventlet/greenthread.py",
    line 214, in main
        result = function(*args, **kwargs)
      File "/opt/stack/nova/nova/utils.py", line 1053, in context_wrapper
        return func(*args, **kwargs)
      File "/opt/stack/nova/nova/virt/libvirt/host.py", line 131, in
    _dispatch_thread
        self._dispatch_events()
      File "/opt/stack/nova/nova/virt/libvirt/host.py", line 236, in
    _dispatch_events

    This commit avoids multiple initializations of the same Host object.
    Thus it fixes the above problems.

    Change-Id: I9cfdbca4986ee6da1e8c42bc0b4477d7d0cb5041
    Closes-bug: #1599688
    Signed-off-by: Xuanzhou Perry Dong <oss_xzdong@163.com>

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 16.0.0.0b1

This issue was fixed in the openstack/nova 16.0.0.0b1 development milestone.

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.