diff options
author | Roman Podoliaka <rpodolyaka@mirantis.com> | 2017-02-15 16:47:42 +0200 |
---|---|---|
committer | Stephen Finucane <sfinucan@redhat.com> | 2017-02-15 16:47:42 +0200 |
commit | a7505ee648b22f5827117bcc1192b5654c29cf9c (patch) | |
tree | b91f7064da7db9971f6d98ec16b16b56a8b60d11 /nova/__init__.py | |
parent | fa1ac7d96507f849089b9bf2123887a303edf594 (diff) | |
download | nova-a7505ee648b22f5827117bcc1192b5654c29cf9c.tar.gz |
Make eventlet hub use a monotonic clock
If system time is adjusted first forward and then backward while a
nova service is running (e.g. nova-compute), then there is a high
probability, that periodic tasks will stop for the duration of time
the system clock was adjusted backward.
This was supposed to be fixed by the following patch to oslo.service
https://review.openstack.org/#/c/286838/ , but the order of imports
in unit tests and production code is different, so nova services
end up starting with the default eventlet hub, that does not use a
monotonic clock and, thus, is affected by changes of system time.
Testing this is problematic, as it's a subject of imports order and
is not reproduced in functional or unit tests (oslo_service is always
imported earlier than eventlet hub is initialized, so it just does
"the right thing"). The alternative is to make an assertion when
services start.
Closes-Bug: #1510234
Change-Id: I110cf31ad2a0c74a0cf30ec08bd94d3a56727b39
Diffstat (limited to 'nova/__init__.py')
-rw-r--r-- | nova/__init__.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nova/__init__.py b/nova/__init__.py index 21403ab570..228c89d33d 100644 --- a/nova/__init__.py +++ b/nova/__init__.py @@ -27,4 +27,9 @@ import os os.environ['EVENTLET_NO_GREENDNS'] = 'yes' +# NOTE(rpodolyaka): import oslo_service first, so that it makes eventlet hub +# use a monotonic clock to avoid issues with drifts of system time (see +# LP 1510234 for details) +import oslo_service # noqa + import eventlet # noqa |