Document that server will start even if it's unable to open some TCP/IP ports

From: Gurjeet Singh <gurjeet(at)singh(dot)im>
To: Postgres Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Document that server will start even if it's unable to open some TCP/IP ports
Date: 2023-05-27 22:17:21
Message-ID: CABwTF4WYPD9ov-kcSq1+J+ZJ5wYDQLXquY6Lu2cvb-Y7pTpSGA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The attached patch clarifies that the server will start even if it is
unable to open the port on some of the TCP/IP addresses listed (or
implied by a value of '*' or localhost) in listen_addresses parameter.

I think it is important to call this out, because I was surprised to
see that the server started even though the port was occupied by
another process. Upon close inspection, I noticed that the other
process was using that port on 127.0.0.1, so Postgres complained about
that interface (a warning in server log), but it was able to open the
port on IPv6 ::1, so it started up as normal.

Upon further testing, I saw that server will not start only if it is
unable to open the port on _all_ the interfaces/addresses. It it's
able to open the port on at least one, the server will start.

If listen_addresses is empty, then server won't try to open any TCP/IP
ports. The patch does not change any language related to that.

Best regards,
Gurjeet
http://Gurje.et

Attachment Content-Type Size
v1-0001-Document-that-the-server-starts-only-if-at-least-.patch application/octet-stream 1.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message MARK CALLAGHAN 2023-05-28 00:15:08 Re: benchmark results comparing versions 15.2 and 16
Previous Message Andres Freund 2023-05-27 18:47:13 Re: testing dist tarballs