[Twisted-Python] task.LoopingCall: a problem if change the system time

Roberto Gomez rfg007 at yahoo.com
Fri Jan 26 09:33:21 EST 2007


Hi everyone,

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

I'm not a twisted expert, but and extensive user and
fan, and I don´t know how to workaround this.

Any clue?
TIA



 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com




More information about the Twisted-Python mailing list