[Dovecot] Time moved backwards

Timo Sirainen tss at iki.fi
Tue May 13 11:56:18 EEST 2008


On Tue, 2008-05-13 at 12:51 +0400, Anton Yuzhaninov wrote:
> Timo Sirainen пишет:
> > On Tue, 2008-05-13 at 11:13 +0400, Eugene wrote:
> > 
> >> I suggest that Dovecot simply terminate the current connections (causing the 
> >> client to reconnect) or -- if the time change is really that much of a 
> >> problem -- to restart itself automatically. 
> > 
> > I guess terminating all current connections and restarting all processes
> > would be pretty safe, but it's not really a high priority change for
> > me..
> 
> IMHO more robust is to use clock_gettime(CLOCK_MONOTONIC, ..) for timeouts and just 
> work fine even if time was changed via settimeofday().

Two problems with that:

1) clock_gettime() doesn't work everywhere (e.g. OSX).

2) With the current design gettimeofday() has to be called anyway to get
the current real timestamp, causing extra unnecessary work.

Anyway that's not the main problem. I'm more concerned about timestamp
comparison code where one or both of the timestamps come from
filesystem. It might cause some corruption, such as dotlock being
deleted while another process still holds it.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20080513/44b68423/attachment.bin 


More information about the dovecot mailing list