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

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: [Windows,PATCH] Use faster, higher precision timer API
Дата
Msg-id CA+TgmoYLa6arf85YbUa97uOt9niAT_YyZKdLUxRgwuc3FD=gHw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [Windows,PATCH] Use faster, higher precision timer API  (Craig Ringer <craig@2ndquadrant.com>)
Список pgsql-hackers
On Fri, Oct 24, 2014 at 1:42 AM, Craig Ringer <craig@2ndquadrant.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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Re: Getting rid of "accept incoming network connections" prompts on OS X
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Getting rid of "accept incoming network connections" prompts on OS X