hawq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lei Chang <lei_ch...@apache.org>
Subject Re: s/gettimeofday/clock_gettime/ in hawq?
Date Tue, 25 Apr 2017 14:40:48 GMT
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 <paulguo@gmail.com> 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
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message