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

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add client connection check during the execution of the query
Date: 2019-07-05 08:46:36
Message-ID: CA+hUKG+TGsHUZ4S6QOXr_ueKJ9-8d-TaoDpk9zdgjB_vHqotzQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 5, 2019 at 6:28 PM Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp> wrote:
> > The purpose of this patch is to stop the execution of continuous
> > requests in case of a disconnection from the client.
>
> Pgpool-II already does this by sending a parameter status message to
> the client. It is expected that clients are always prepared to receive
> the parameter status message. This way I believe we could reliably
> detect that the connection to the client is broken or not.

Hmm. If you send a message, it's basically application-level
keepalive. But it's a lot harder to be sure that the protocol and
socket are in the right state to insert a message at every possible
CHECK_FOR_INTERRUPT() location. Sergey's proposal of recv(MSG_PEEK)
doesn't require any knowledge of the protocol at all, though it
probably does need TCP keepalive to be configured to be useful for
remote connections.

--
Thomas Munro
https://enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2019-07-05 09:00:48 Re: [PATCH] Implement uuid_version()
Previous Message Tomas Vondra 2019-07-05 08:36:59 Re: mcvstats serialization code is still shy of a load