]> git.ipfire.org Git - thirdparty/tornado.git/commit
ioloop: Fix PeriodicCallback when system clock moves backwards
authorBen Darnell <ben@bendarnell.com>
Sat, 31 Mar 2018 22:01:57 +0000 (18:01 -0400)
committerBen Darnell <ben@bendarnell.com>
Sat, 7 Apr 2018 23:03:13 +0000 (19:03 -0400)
commita56d354117faf2fc57dc12eea8506ab9c759174a
treeb4e94f3ae984fc52a4aa675f083e48431c70b6f4
parent0412a3ee1e220e149ddd85583aad73d3683f6bbd
ioloop: Fix PeriodicCallback when system clock moves backwards

If the clock moves backwards a little bit, we could run a
PeriodicCallback twice in a row prior to this change.

Due to implementation differences between the Tornado and asyncio
event loops, this is most common when using the asyncio event loop on
windows (where in some environments differences between time.time()
and time.monotonic() can result in behavior that looks like small
backwards time jumps on every iteration), although it can in principle
occur in any environment.

Fixes #2333
tornado/ioloop.py
tornado/test/ioloop_test.py