Re: [Windows,PATCH] Use faster, higher precision timer API

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Fabris Giovanni Consulente <cons(dot)FabrisGiovanni(at)sia(dot)eu>
Subject: Re: [Windows,PATCH] Use faster, higher precision timer API
Date: 2014-10-24 13:57:30
Message-ID: CA+TgmoYLa6arf85YbUa97uOt9niAT_YyZKdLUxRgwuc3FD=gHw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Oct 24, 2014 at 1:42 AM, Craig Ringer <craig(at)2ndquadrant(dot)com> wrote:
> On 10/23/2014 09:21 PM, Robert Haas wrote:
>> Agreed - I think if you want an error check here it should use elog()
>> or ereport(), not Assert().
>
> That's what I originally did, but it's too early for elog.
>
> I'm reluctant to just fprintf(...) to stderr, as there's no way for the
> user to suppress that, and it'll be emitted for each backend start.
> Though on the other hand it really is a "shouldn't happen" case.
>
> So the options seem to be ignoring the error silently or printing to stderr.

Either of those is OK with me. I think it's a bad idea to use
Assert() to check the results of system calls, because an assertion
failure is supposed to indicate a bug in our code, not Microsoft's
code. But printing to stderr is an acceptable way of indicating an
error that happens very early, and ignoring doesn't look unreasonable
in this context either. Yet another option is to do nothing about the
error at the time that it's reported but store the error code
somewhere and use it to generate an error message once the system is
initialized. I'm tentatively inclined to believe that's more
machinery than this particular case justifies, but will happily defer
to any emerging consensus.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2014-10-24 14:05:16 Re: Getting rid of "accept incoming network connections" prompts on OS X
Previous Message Robert Haas 2014-10-24 13:49:36 Re: Re: Getting rid of "accept incoming network connections" prompts on OS X