Ask Your Question
0

The different about time.sleep & eventlet.sleep

asked 2014-03-09 21:31:38 -0600

Lee Li gravatar image

Hi, I have do a test like:

test1.py import time

def sleep_test(): print time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())) time.sleep(30) print time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))

sleep_test()

test2.py import time import eventlet

def sleep_test(): print time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())) time.sleep(30) print time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))

eventlet.monkey_patch() sleep_test()

When sleeping, I modify the system time with a past time. test1.py's resut: 2014-03-07 11:56:21 2014-03-07 11:52:17 the sleep time = 30 but the test2.py result: 2014-03-07 11:55:19 2014-03-07 11:55:49 the sleep time = past time + 30

If the past time is too long(such as 10 mins), may cause lost contact between ovs-agent and neutron-server. I think other projects may have this problem too. How can we deal the differents?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-03-10 01:32:09 -0600

unmesh-gurjar gravatar image

OpenStack documentation mentions installing NTP on each system running OpenStack services and set their time from the controller node. Configuring it this way, will prevent such issues.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-03-09 21:31:38 -0600

Seen: 150 times

Last updated: Mar 10 '14