[Twisted-Python] a question about monotonic clock

Tristan Seligmann mithrandi at mithrandi.net
Mon Oct 29 05:59:02 EDT 2012

On Mon, Oct 29, 2012 at 10:33 AM, Phil Mayers <p.mayers at imperial.ac.uk> wrote:
> On 10/28/2012 10:16 PM, Tristan Seligmann wrote:
>> On Mon, Oct 29, 2012 at 12:05 AM, Phil Mayers <p.mayers at imperial.ac.uk> wrote:
> Sadly, this is not the case. As has already been pointed out, virtual
> machine clocks can undergo stepping in "normal" oepration. A specfic
> example: if a VMWare installation performs live migration of a host. We
> often see:
> ntpd[1793]: time reset +0.263757 s
> ...when this happens. This can occur several times a day, as we're
> running vCenter-controlled auto-migration - a very common setup. This is
> forward stepping of course, so is relatively harmless (backward is a pain).

My original reply was perhaps a bit... exclusionary. But I think the
point I was trying to make is still valid; if your VM is suspended for
250ms due to a migration (or CPU throttling, or ...) then it is
impossible to maintain a consistent stream of time events because
there isn't any code executing at all. Whether the clock stalls, or is
jumped forward 250ms, you still have an unavoidable problem as far as
time-keeping is concerned.

>>> Who knows what newer implementations like chrony or openntpd do!
>> If they're doing something silly, then maybe you shouldn't use them.

I didn't intend it that way, but I can see how what I said could be
read in a hostile / defensive tone. Perhaps this would be a better

If chrony or openntpd are doing something sensible, then there
shouldn't be any serious issues with using them; if they're doing
something that seriously destabilizes the system clock, then you
probably shouldn't be using them, at least not if you want reliable
timekeeping. I'm not familiar enough with either of them to know which
case applies, so I didn't intend to come across as bashing chrony
and/or openntpd.

> Maybe "Twisted doesn't need a monotonic clock" is the right reply, but
> it would be wrong to base that on the assumpton that "ntpd doesn't step"
> - that's all I was trying to say.

I don't think anyone in this thread is arguing *against* implementing
this functionality; I think the point was just that this functionality
is only of critical importance under a limited range of circumstances,
as opposed to being something of urgent need for every Twisted-using
program that needs to schedule timed events.
mithrandi, i Ainil en-Balandor, a faer Ambar

More information about the Twisted-Python mailing list