Good catch. There are a lot of uses of getimeofday for timeout. clock_gettime is also affected by NTP if NTP moves time back except that CLOCK_MONOTONIC option is used.
Thanks Lei On Mon, Apr 24, 2017 at 1:36 PM, Paul Guo <[email protected]> wrote: > Hi, > > HAWQ sometimes use gettimeofday() syscall for some timeout check in various > module, however it could be affected by ntp, so the timeout checking logic > could be wrong sometimes. I would propose to use clock_gettime() to replace > it on Linux (I have not investigated the alternative on other platforms > e.g. mac). Both gettimeofday() and clock_gettime() are fast vdso sys call > so I do not expect there is performance loss in some case where there are > frequent calls of gettimeofday(). By the way, I found some gettimeofday() > calls on postgresql and gpdb, so they might have this issue also. > > Regards, > > Paul >
