Re: POC: Carefully exposing information without authentication

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
Cc: Antonin Houska <ah(at)cybertec(dot)at>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: POC: Carefully exposing information without authentication
Date: 2025-05-31 01:34:47
Message-ID: 2724612.1748655287@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Sabino Mullane <htamfids(at)gmail(dot)com> writes:
> Good question. Forking is expensive, and there is also a lot of
> housekeeping associated with it that is simply not needed here. We want
> this to be lightweight, and simple. No need to fork if we are just going to
> do a few strncmp() calls and a send().

send() can block. I think calling it in the postmaster is a
nonstarter. For comparison, we make an effort to not do any
communication with incoming clients until after forking a child
to do the communication. The one exception is if we have to
report fork failure --- but we don't make any strong guarantees
about that report succeeding. (IIRC, we put the port into nonblock
mode and try only once.) That's probably not a behavior you want
to adopt for non-edge-case usages.

Another point is that you'll recall that there's a lot of
interest in switching to a threaded model. The argument that
"fork is too expensive" may not have a long shelf life.

I'm not taking a position on whether $SUBJECT is a good idea
in the first place.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Lakhin 2025-05-31 03:00:00 Re: Non-reproducible AIO failure
Previous Message Michael Paquier 2025-05-31 00:48:52 Re: Speedup truncations of temporary relation forks