pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use FD_CLOEXEC on ListenSockets
Date: Thu, 24 Aug 2023 14:04:18 +0000
Message-ID: <E1qZAwc-000fIy-I5@gemulon.postgresql.org> (raw)

Use FD_CLOEXEC on ListenSockets

It's good hygiene if e.g. an extension launches a subprogram when
being loaded. We went through some effort to close them in the child
process in EXEC_BACKEND mode, but it's better to not hand them down to
the child process in the first place. We still need to close them
after fork when !EXEC_BACKEND, but it's a little simpler.

In the passing, LOG a message if closing the client connection or
listen socket fails. Shouldn't happen, but if it does, would be nice
to know.

Reviewed-by: Tristan Partin, Andres Freund, Thomas Munro
Discussion: https://www.postgresql.org/message-id/7a59b073-5b5b-151e-7ed3-8b01ff7ce9ef@iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b0bea38705b2d14e57d353a701ecfdb8a04983b1

Modified Files
--------------
src/backend/libpq/pqcomm.c          |  6 +++++-
src/backend/postmaster/postmaster.c | 14 ++++++--------
2 files changed, 11 insertions(+), 9 deletions(-)



Message-ID: <E1qZAwc-000fIy-I5@gemulon.postgresql.org>
Permalink:  ../E1qZAwc-000fIy-I5@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qZAwc-000fIy-I5@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: heikki.linnakangas@iki.fi, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Use FD_CLOEXEC on ListenSockets
  In-Reply-To: <E1qZAwc-000fIy-I5@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox