]> git.ipfire.org Git - thirdparty/tornado.git/commit
ioloop: Fix PeriodicCallback when system clock moves backwards 2338/head
authorBen Darnell <ben@bendarnell.com>
Sat, 31 Mar 2018 22:01:57 +0000 (18:01 -0400)
committerBen Darnell <ben@bendarnell.com>
Fri, 6 Apr 2018 16:46:12 +0000 (12:46 -0400)
commit886643965b5cb782503d8d7b374b7a794ec2077b
treee2062af33c0c56447ef880271eaefe203b083334
parent2d4053daa56c609d642b214399e046671d4a593e
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