Re: Dangling Client Backend Process

From: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Dangling Client Backend Process
Date: 2015-10-12 07:13:13
Message-ID: BF2827DCCE55594C8D7A8F7FFD3AB771599653F7@szxeml521-mbs.china.huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10 October 2015 20:45, Amit Kapila 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. I think that thread didn't reach to conclusion,
> but there were couple of other reasons discussed in that thread as well to
> have the behaviour as you are proposing here.

Oops..I did not know about this. I shall check the older thread to get other opinions.

>> One way to handle this issue will be to check whether postmaster is alive after every command read but it will add extra cost for each query execution.

> I don't think that is a good idea as if there is no command execution
> it will still stay as it is and doing such operations on each command
> doesn't sound to be good idea even though overhead might not be
> big. There are some other ideas discussed in that thread [2] to achieve
> this behaviour, but I think we need to find a portable way to achieve it.

Yes, you are right that process will not be closed till a new command comes but I think it does not harm functionality in anyway except that the process and its acquired resources
does not get freed. Also use-case of application will be very less where their client process stays idle for very long time.
But at the same time I agree this is not the best solution, we should look for more appropriate/better one.
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.

Thanks and Regards,
Kumar Rajeev Rastogi

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2015-10-12 07:47:13 Re: More work on SortSupport for text - strcoll() and strxfrm() caching
Previous Message Haribabu Kommi 2015-10-12 06:21:26 Re: Parallel Seq Scan