PostgresNode::_update_pid using undefined variables in tap tests

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема PostgresNode::_update_pid using undefined variables in tap tests
Дата
Msg-id CAB7nPqTOP28Zxv_SXFo2axGJoesfvLLMO6syddAfV0DUvsFMDw@mail.gmail.com
обсуждение исходный текст
Ответы Re: PostgresNode::_update_pid using undefined variables in tap tests  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Hi all,

While running the test suite this morning I have noticed the following error:
server stopped
readline() on closed filehandle $pidfile at
/Users/ioltas/git/postgres/src/bin/pg_rewind/../../../src/test/perl/PostgresNode.pm
line 308.
Use of uninitialized value in concatenation (.) or string at
/Users/ioltas/git/postgres/src/bin/pg_rewind/../../../src/test/perl/PostgresNode.pm
line 309.
# Postmaster PID is

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.
Regards,
--
Michael

Вложения

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: psql --help=variables lists variables that can't be set
Следующее
От: Haribabu Kommi
Дата:
Сообщение: Re: pg_hba_lookup function to get all matching pg_hba.conf entries