Re: PostgresNode::_update_pid using undefined variables in tap tests

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: PostgresNode::_update_pid using undefined variables in tap tests
Дата
Msg-id CAB7nPqQOx-irB9OOr=ejFzxd-VXYdJxsF-yO+LAu5uGhrvJp3Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PostgresNode::_update_pid using undefined variables in tap tests  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: PostgresNode::_update_pid using undefined variables in tap tests  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: PostgresNode::_update_pid using undefined variables in tap tests  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Wed, Dec 9, 2015 at 4:47 AM, Robert Haas <robertmhaas@gmail.com> wrote:
>
> On Thu, Dec 3, 2015 at 11:28 PM, Michael Paquier
> <michael.paquier@gmail.com> wrote:
> > This does not impact the run, but it creates unwelcome warnings in the
> > logs. This is actually caused by the following code in PostgresNode
> > that uses an incorrect check to see if the file has been correctly
> > opened or not:
> >     open my $pidfile, $self->data_dir . "/postmaster.pid";
> >     if (not defined $pidfile)
> >
> > One way to fix this is to use if(open(...)), a second way I know of is
> > to check if the opened file handle matches tell($pidfile) == -1. The
> > patch attached uses the first method to fix the issue.
>
> My Perl-fu must be getting weak.  What's wrong with the existing code?

This code should have checked for the return result of open instead of
looking at $pidfile. This has been noticed by Noah as well afterwards
and already addressed as 9821492.
-- 
Michael



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Patch: ResourceOwner optimization for tables with many partitions
Следующее
От: "Olson, Ken"
Дата:
Сообщение: Re: dynloader.h missing in prebuilt package for Windows?