Re: Dangling Client Backend Process

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Dangling Client Backend Process
Date: 2015-10-14 05:38:37
Message-ID: CAA4eK1L8SGWymhXF+yDpxiyA2ARCiEgQ88XsLhEvJba3Fh_F=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 13, 2015 at 3:54 PM, Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>
wrote:

> On 12th October 2015 20:45, Rajeev Rastogi Wrote:
>
>
>
> >>> I observed one strange behavior today that if postmaster process gets
> crashed/killed, then it kill all background processes but not the client
> backend process.
>
>
>
> >> This is a known behaviour and there was some discussion on this
>
> >> topic [1] previously as well.
>
>
>
> > Now as it is confirmed to be valid issue, I will spend some time on this
> to find if there is something more appropriate solution.
>
>
>
> I checked the latest code and found Heikki has already added code for
> secure_read using the latch mechanism (using WaitLatchOrSocket). It
> currently waits for two events i.e. WL_LATCH_SET and WL_SOCKET_READABLE.
>
> Commit id: 80788a431e9bff06314a054109fdea66ac538199
>
>
>
> If we add the event WL_POSTMASTER_DEATH also, client backend process
> handling will become same as other backend process. So postmaster death can
> be detected in the same way.
>
>
>
> But I am not sure if WL_POSTMASTER_DEATH event was not added intentionally
> for some reason. Please confirm.
>
> Also is it OK to add this even handling in generic path of Libpq?
>
>
>
> Please let me know if I am missing something?
>
>
I feel this is worth investigation, example for what kind of cases libpq is
used for non-blocking sockets, because for such cases above idea
will not work.

Here, I think the bigger point is that, Tom was not in favour of
this proposal (making backends exit on postmaster death ) at that time,
not sure whether he has changed his mind.

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gavin Flower 2015-10-14 05:41:40 Re: Release of CVEs
Previous Message Tom Lane 2015-10-14 05:19:37 Re: Release of CVEs