Re: Add client connection check during the execution of the query

From: Andres Freund <andres(at)anarazel(dot)de>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Zhihong Yu <zyu(at)yugabyte(dot)com>
Subject: Re: Add client connection check during the execution of the query
Date: 2021-03-24 05:02:11
Message-ID: 20210324050211.f6hzgugxb3kkttxi@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2021-03-24 16:08:13 +1300, Thomas Munro wrote:
> ... Andres just asked me the same question, when we were discussing
> the pq_peekmessage() patch (v7). I had remembered that POLLHUP didn't
> work for this type of thing, from some earlier attempt at something
> similar, and indeed on my first attempt to do that here as an
> alternative design, it did not work... with TCP sockets (localhost)...
> though it did work with Unix sockets. Gah! Then he pointed me at
> POLLRDHUP (a Linux only extension) and that did seem to work in all
> cases I tried. But without that, this v8 patch doesn't seem to work
> on FreeBSD (TCP), and for the rest of the menagerie, who knows?
> Here's a sketch patch like that for discussion.
> It's frustrating, because this patch is so simple, and doesn't have
> v7's problem with pipelined queries. Hmm.

It is indeed frustrating. I searched a bit for other OSs and POLLRDHUP
and I'm annoyed by responses from various OS folks of "You don't need
that, just read the data upon POLLIN...".

I don't like the feature not handling pipelining etc, nor does working
undetectedly only on linux seem like a great answer. I guess we could
have the template files tell us wether it work, or configure test it,
but brrr.

I'm mostly joking, and I've not read the thread, but I assume just
sending an empty NoticeResponse or error message has been brought up and
laughed out of the room?

> (I tried to make it work on Windows too by reading the manual, no idea
> if that part compiles or works).

If the patch had tests, cfbot might tell you :)

Greetings,

Andres Freund

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Maxim Orlov 2021-03-24 05:02:53 Re: Failed assertion on standby while shutdown
Previous Message Michael Paquier 2021-03-24 04:54:28 Re: Allow matching whole DN from a client certificate