You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hawq.apache.org by Paul Guo <pa...@gmail.com> on 2017/04/24 05:36:12 UTC
s/gettimeofday/clock_gettime/ in hawq?
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
Re: s/gettimeofday/clock_gettime/ in hawq?
Posted by Paul Guo <pa...@gmail.com>.
Thanks. So we could check whether clock_gettime() exists or not during
configure and then in code if needed we fall back to gettimeofday().
2017-04-24 15:40 GMT+08:00 Michael Pearce <Mi...@ig.com>:
> Hi,
>
> clock_gettime i believe was made native available in macOS Sierra (10.12).
>
> prior versions though don't afaik. Though with the aggressive upgrade of
> OSX on apple devices that apple push, to end users is this really a concern?
>
> As per posix guidance also, what you suggest is also recommended as
> gettimeofday is obsolescent.
>
> http://pubs.opengroup.org/onlinepubs/9699919799/
> functions/gettimeofday.html
>
> Regards
> Mike
>
> ________________________________________
> From: Paul Guo <pa...@gmail.com>
> Sent: Monday, April 24, 2017 6:36 AM
> To: dev@hawq.incubator.apache.org
> Subject: s/gettimeofday/clock_gettime/ in hawq?
>
> 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
> The information contained in this email is strictly confidential and for
> the use of the addressee only, unless otherwise indicated. If you are not
> the intended recipient, please do not read, copy, use or disclose to others
> this message or any attachment. Please also notify the sender by replying
> to this email or by telephone (+44(020 7896 0011) and then delete the email
> and any copies of it. Opinions, conclusion (etc) that do not relate to the
> official business of this company shall be understood as neither given nor
> endorsed by it. IG is a trading name of IG Markets Limited (a company
> registered in England and Wales, company number 04008957) and IG Index
> Limited (a company registered in England and Wales, company number
> 01190902). Registered address at Cannon Bridge House, 25 Dowgate Hill,
> London EC4R 2YA. Both IG Markets Limited (register number 195355) and IG
> Index Limited (register number 114059) are authorised and regulated by the
> Financial Conduct Authority.
>
Re: s/gettimeofday/clock_gettime/ in hawq?
Posted by Michael Pearce <Mi...@ig.com>.
Hi,
clock_gettime i believe was made native available in macOS Sierra (10.12).
prior versions though don't afaik. Though with the aggressive upgrade of OSX on apple devices that apple push, to end users is this really a concern?
As per posix guidance also, what you suggest is also recommended as gettimeofday is obsolescent.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/gettimeofday.html
Regards
Mike
________________________________________
From: Paul Guo <pa...@gmail.com>
Sent: Monday, April 24, 2017 6:36 AM
To: dev@hawq.incubator.apache.org
Subject: s/gettimeofday/clock_gettime/ in hawq?
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
The information contained in this email is strictly confidential and for the use of the addressee only, unless otherwise indicated. If you are not the intended recipient, please do not read, copy, use or disclose to others this message or any attachment. Please also notify the sender by replying to this email or by telephone (+44(020 7896 0011) and then delete the email and any copies of it. Opinions, conclusion (etc) that do not relate to the official business of this company shall be understood as neither given nor endorsed by it. IG is a trading name of IG Markets Limited (a company registered in England and Wales, company number 04008957) and IG Index Limited (a company registered in England and Wales, company number 01190902). Registered address at Cannon Bridge House, 25 Dowgate Hill, London EC4R 2YA. Both IG Markets Limited (register number 195355) and IG Index Limited (register number 114059) are authorised and regulated by the Financial Conduct Authority.
Re: s/gettimeofday/clock_gettime/ in hawq?
Posted by Paul Guo <pa...@gmail.com>.
Exactly.
2017-04-25 22:40 GMT+08:00 Lei Chang <le...@apache.org>:
> 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 <pa...@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
> >
>
Re: s/gettimeofday/clock_gettime/ in hawq?
Posted by Lei Chang <le...@apache.org>.
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 <pa...@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
>