nova-compute stop report state after system time changed

Bug #1744920 reported by John Smith
This bug report is a duplicate of:  Bug #1510234: Heartbeats stop when time is changed. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
New
Undecided
Charlotte Han

Bug Description

Description
===========
On compute node,if system time changed by NTP or using cmd "date -s",change time from 14:00:00 to 12:00:00 for example,the nova-compute service will stop reporting state to controller. Then nova service-list show the nova-compute service will be down.
In fact other periodic task such as _sync_power_states, also stopped.

I think system time change should not effect nova-compute.

Steps to reproduce
==================
It is 14:00:00 now for example, change system time to 12:00:00
    $ date -s 12:00:00
then we can find there is no log in nova-compute.log for a long time.

and nova service-list show the service is down.
+--------------------------------------+------------------+------------------+----------+---------+-------+----------------------------+-----------------+-------------+
| Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason | Forced down |
+--------------------------------------+------------------+------------------+----------+---------+-------+----------------------------+-----------------+-------------+

| 3d0ea985-bc45-4cae-b45f-876520163dfa | nova-compute | nail-5300-2 | test1 | enabled | down | 2018-01-23T09:47:48.000000 | - | False |

Expected result
===============
nova service-list show nova-compute service still up.

Actual result
=============
nova service-list show the nova-compute service is down.

Environment
===========
openstack: Pike
python: python2.7
hypervisor: libvirt + KVM

Revision history for this message
Charlotte Han (hanrong) wrote :

[root@nail-5300-2 oslo_service]# /usr/bin/python2 /usr/bin/nova-compute
> /usr/lib/python2.7/site-packages/eventlet/hubs/__init__.py(115)get_hub()
-> try:
(Pdb) c
> /usr/lib/python2.7/site-packages/eventlet/hubs/__init__.py(70)use_hub()
-> if mod is None:
(Pdb) w
  /usr/bin/nova-compute(6)<module>()
-> from nova.cmd.compute import main
  /usr/lib/python2.7/site-packages/nova/cmd/compute.py(28)<module>()
-> from nova.cmd import common as cmd_common
  /usr/lib/python2.7/site-packages/nova/cmd/common.py(28)<module>()
-> import nova.conf
  /usr/lib/python2.7/site-packages/nova/conf/__init__.py(27)<module>()
-> from nova.conf import cinder
  /usr/lib/python2.7/site-packages/nova/conf/cinder.py(16)<module>()
-> from keystoneauth1 import loading as ks_loading
  /usr/lib/python2.7/site-packages/keystoneauth1/loading/__init__.py(13)<module>()
-> from keystoneauth1.loading import adapter
  /usr/lib/python2.7/site-packages/keystoneauth1/loading/adapter.py(13)<module>()
-> from keystoneauth1 import adapter
  /usr/lib/python2.7/site-packages/keystoneauth1/adapter.py(18)<module>()
-> from keystoneauth1 import session
  /usr/lib/python2.7/site-packages/keystoneauth1/session.py(26)<module>()
-> import requests
  /usr/lib/python2.7/site-packages/requests/__init__.py(52)<module>()
-> from .packages.urllib3.contrib import pyopenssl
  /usr/lib/python2.7/site-packages/requests/packages/__init__.py(27)<module>()
-> from . import urllib3
  /usr/lib/python2.7/site-packages/requests/packages/urllib3/__init__.py(8)<module>()
-> from .connectionpool import (
  /usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py(35)<module>()
-> from .connection import (
  /usr/lib/python2.7/site-packages/requests/packages/urllib3/connection.py(44)<module>()
-> from .util.ssl_ import (
  /usr/lib/python2.7/site-packages/requests/packages/urllib3/util/__init__.py(3)<module>()
-> from .connection import is_connection_dropped
  /usr/lib/python2.7/site-packages/requests/packages/urllib3/util/connection.py(144)<module>()
-> HAS_IPV6 = _has_ipv6('::1')
  /usr/lib/python2.7/site-packages/requests/packages/urllib3/util/connection.py(134)_has_ipv6()
-> sock = socket.socket(socket.AF_INET6)
  /usr/lib/python2.7/site-packages/eventlet/greenio/base.py(133)__init__()
-> notify_opened(fd.fileno())
  /usr/lib/python2.7/site-packages/eventlet/hubs/__init__.py(193)notify_opened()
-> hub = get_hub()
  /usr/lib/python2.7/site-packages/eventlet/hubs/__init__.py(115)get_hub()
-> try:
> /usr/lib/python2.7/site-packages/eventlet/hubs/__init__.py(70)use_hub()
-> if mod is None:
(Pdb) os.environ['EVENTLET_HUB']
*** KeyError: 'EVENTLET_HUB'
(Pdb)

os.environ['EVENTLET_HUB'] should be 'oslo_service:service_hub' when get_hub function was used for the first time.

Charlotte Han (hanrong)
Changed in nova:
assignee: nobody → Charlotte Han (hanrong)
Revision history for this message
John Smith (wang-zengzhi) wrote :

This issue was fixed in master, see: https://bugs.launchpad.net/nova/+bug/1510234,but not merged in PIKE.

Here I cherry pick this to PIKE:
https://review.openstack.org/#/c/537811/

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.