The different about time.sleep & eventlet.sleep
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?