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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Subject: Re: PostgresNode::_update_pid using undefined variables in tap tests
Date: 2015-12-08 19:47:23
Message-ID: CA+TgmoZKT_=Q0sbOrBbpjj6jXeSU6pOsJgujCBOZtTgy5o9mNA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 3, 2015 at 11:28 PM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)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?

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-12-08 20:02:55 Re: fix for readline terminal size problems when window is resized with open pager
Previous Message Robert Haas 2015-12-08 19:45:03 Re: W-TinyLfu for cache eviction