Re: [PATCH] Allow Postgres to pick an unused port to listen

From: Yurii Rashkovskii <yrashk(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Allow Postgres to pick an unused port to listen
Date: 2023-04-12 02:17:29
Message-ID: CA+RLCQwmNGvENLWaHwh3gDMnDUWyopV35+V3dXsNUA9A6_ZxKQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Robert,

On Tue, Apr 11, 2023 at 12:54 AM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Fri, Apr 7, 2023 at 5:34 PM Yurii Rashkovskii <yrashk(at)gmail(dot)com> wrote:
> > I'm trying to understand what's wrong with reading port from the pid
> file (if Postgres writes information there, it's surely so that somebody
> can read it, otherwise, why write it in the first placd)? The proposed
> solution uses operating system's functionality to achieve collision-free
> mechanics with none of the complexity introduced in the commit.
>
> I agree. We don't document the exact format of the postmaster.pid file
> to my knowledge, but storage.sgml lists all the things it contains,
> and runtime.sgml documents that the first line contains the postmaster
> PID, so this is clearly not some totally opaque file that nobody
> should ever touch. Consequently, I don't agree with Tom's statement
> that this would be a "a horrid way to find out what was picked." There
> is some question in my mind about whether this is a feature that we
> want PostgreSQL to have, and if we do want it, there may be some room
> for debate about how it's implemented, but I reject the idea that
> extracting the port number from postmaster.pid is intrinsically a
> terrible plan. It seems like a perfectly reasonable plan.
>
>
I appreciate your support on the pid file concern. What questions do you
have about this feature with regard to its desirability and/or
implementation? I'd love to learn from your insight and address any of
those if I can.

--
Y.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2023-04-12 02:19:52 Re: Fix fseek() detection of unseekable files on WIN32
Previous Message Richard Guo 2023-04-12 01:59:22 Re: Protecting allocator headers with Valgrind