On Wed, 2007-02-28 at 16:15 -0500, Ben Winslow wrote:
http://dovecot.org/list/dovecot-cvs/2007-February/007906.html
Way too much trouble to try to handle it correctly.
What about logging a warning and iterating through ioloop->timeouts and subtracting (ioloop_time - ioloop_timeval.tv_sec) from each next_run.tv_sec? That way, the absolute worst case would be a doubled timeout (e.g. a poll starts with 2 timeouts, one with 9 seconds remaining, and one with 10 seconds remaining, the time time goes backwards, the poll times out, and each timer has 9 seconds added to it.)
Given how infrequently the clock is likely to go backwards, the impact would probably be unnoticable, and a doubled timeout seems a lot more graceful than dying... however, there might be other things that could break that I don't know about...
Yes, if only the timeouts were the problem that would be easy to fix. But there exists a lot of code that compares timestamps, and I think some of that code can break pretty badly.