Ticket #2424 defect new
Add reactor option to start with monotonic clock (was: LoopingCall problem)
| Reported by: | rfg007 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | core | Keywords: | |
| Cc: | spiv, ivank, zooko@… | Branch: | |
| Author: | Launchpad Bug: |
Description
I wrote a simple test trying to find why my app freeze when change the system time:
from twisted.internet import reactor, task
import time
def callback():
print time.ctime(time.time())
t = task.LoopingCall(callback)
t.start(2.0)
reactor.run()
If run this and change the system time, let's say a day forward, everything work fine, but if change the system time backward, the program freeze until you change forward again. This is specially problematic for a computer using ntp, updating its clock time to time.
It seems that there is a problem in LoopingCall._reschedule that don't play well when "fromNow = self.starttime - self._seconds()" is negative, and seems to be platform independent:
W2k Pro python 2.4.4 twisted 2.4.0
Wxp Pro python 2.4.4 twisted 2.4.0
Ubuntu Linux 5.1 python 2.4.2 twisted 2.0.1-4
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

