Re: Use FD_CLOEXEC on ListenSockets (was Re: Refactoring backend fork+exec code)

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Tristan Partin <tristan(at)neon(dot)tech>
Subject: Re: Use FD_CLOEXEC on ListenSockets (was Re: Refactoring backend fork+exec code)
Date: 2023-08-28 15:55:52
Message-ID: CAMkU=1ysxRSGtJMzMj1MYT6h+TsXFMv6PhD_ZDgPazVAYQyMiw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 24, 2023 at 10:05 AM Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:

> On 24/08/2023 15:48, Thomas Munro wrote:
> > LGTM. I vaguely recall thinking that it might be better to keep
> > EXEC_BACKEND and !EXEC_BACKEND working the same which might be why I
> > didn't try this one, but it looks fine with the comment to explain, as
> > you have it. (It's a shame we can't use O_CLOFORK.)
>
> Yeah, O_CLOFORK would be nice..
>
> Committed, thanks!
>
>
Since this commit, I'm getting a lot (63 per restart) of messages:

LOG: could not close client or listen socket: Bad file descriptor

All I have to do to get the message is turn logging_collector = on and
restart.

The close failure condition existed before the commit, it just wasn't
logged before. So, did the extra logging added here just uncover a
pre-existing bug?

The LOG message is sent to the terminal, not to the log file.

Cheers,

Jeff

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2023-08-28 15:57:03 Re: Disabling Heap-Only Tuples
Previous Message Matthias van de Meent 2023-08-28 15:49:50 Re: Disabling Heap-Only Tuples