[ovs-git] Open vSwitch: timeval: Use monotonic time in OVS Python timeval library. (master)

dev at openvswitch.org dev at openvswitch.org
Fri May 30 23:04:02 UTC 2014

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".

The branch, master has been updated
       via  8396f8070bb35006fcd14486296fb203646a8dfa (commit)
      from  1481a7551da6893c08fb93bee9ac8293b90aa6a6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8396f8070bb35006fcd14486296fb203646a8dfa
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=8396f8070bb35006fcd14486296fb203646a8dfa
Author: Ryan Wilson <wryan at nicira.com>
timeval: Use monotonic time in OVS Python timeval library.
Python's time.time() function uses the system wall clock. However,
if NTP resets the wall clock to be a time in the past, then this
causes any applications that poll block based on time, such as
ovs-xapi-sync, to poll block indefinitely since the time is
unexpectedly negative.

This patch fixes the issue by using time.monotonic() if Python's
version >= 3.3. Otherwise, the timeval module calls out to the
librt C shared library and uses the clock_gettime function with

Note this is only enabled on Linux-based platforms. This has been
tested on Ubuntu 12.04 and Redhat 6.4.

Bug #1189434
Signed-off-by: Ryan Wilson <wryan at nicira.com>
Acked-by: Ethan Jackson <ethan at nicira.com>


Summary of changes:
 python/ovs/timeval.py |   34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

Open vSwitch

More information about the git mailing list