Re: Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: noah(at)leadboat(dot)com
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, robertmhaas(at)gmail(dot)com, kondo(at)sraoss(dot)co(dot)jp, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')
Date: 2015-10-29 08:39:36
Message-ID: 20151029.173936.1376347971522153564.t-ishii@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

> On Tue, Oct 27, 2015 at 05:31:25PM +0900, Tatsuo Ishii wrote:
>> > No, PQping("host='127.0.0.1'") fails to reach a listen_addresses='::' server
>> > on many systems. Here's what I thought Kondo was proposing:
>> >
>> > --- a/src/bin/pg_ctl/pg_ctl.c
>> > +++ b/src/bin/pg_ctl/pg_ctl.c
>> > @@ -649,5 +649,9 @@ test_postmaster_connection(pgpid_t pm_pid, bool do_checkpoint)
>> >
>> > - /* If postmaster is listening on "*", use localhost */
>> > + /* explanation here */
>> > if (strcmp(host_str, "*") == 0)
>> > strcpy(host_str, "localhost");
>> > + else if (strcmp(host_str, "0.0.0.0") == 0)
>> > + strcpy(host_str, "127.0.0.1");
>> > + else if (strcmp(host_str, "::") == 0)
>> > + strcpy(host_str, "::1");
>> >
>>
>> I see. Would you like to commit this?
>
> I am happy to finish it, but I am no less happy if you finish it. Which do
> you prefer?

Please go ahead and commit.

> Should the back-branch commits mirror the master branch? A more-cautious
> alternative would be to, in back branches, wrap the change in #ifdefs so it
> takes effect only on Windows, OpenBSD and NetBSD. It could break setups with
> local firewall rules that block connections to "127.0.0.1" or "::1" without
> blocking "0.0.0.0" or "::". Such firewall rules sound outlandish enough that
> I would be fairly comfortable not worrying about this and making the change
> unconditional in all branches. It's a judgment call, though.

I think back patching with #ifdefs is better. On Windows etc. the case
has been broken anyway and the fix should only bring benefits to users.

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Robinson 2015-10-29 10:37:34 Re: BUG #13739: Recurring corrupted page pointer panics on hot-standby replica
Previous Message Noah Misch 2015-10-29 03:37:48 Re: Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

Browse pgsql-hackers by date

  From Date Subject
Next Message Vladimir Borodin 2015-10-29 08:42:57 Re: [ADMIN] Replication slots and isolation levels
Previous Message Amit Langote 2015-10-29 08:27:12 Re: Cross-check recent documentation changes