Re: bug in SignalSomeChildren

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: bug in SignalSomeChildren
Date: 2010-12-20 20:08:02
Message-ID: AANLkTikU-SfvkuW3XbD=zwmvGQ86jk7ezXpTOtuPfEMi@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Dec 20, 2010 at 2:23 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> Another option that might be workable (but I have reservations, and
>> haven't tested it either) is to check whether the return value of
>> getppid() is equal to 1.  If it's neither 1 nor PostmasterPid then try
>> kill().
>
> I like that better actually ... one less thing for developers to get wrong.

The attached patch appears to work correctly on MacOS X. I did check,
BTW: getppid() in the attached process returns gdb's pid. Poor!

For my own purposes, I would be just as happy to apply this only to
master. But I wonder if anyone wants to argue for back-patching, to
help debug existing installations?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment Content-Type Size
postmaster-is-alive-bsd-workaround.patch application/octet-stream 1.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-12-20 20:08:48 Re: Extensions, patch v20 (bitrot fixes)
Previous Message Kenneth Marshall 2010-12-20 19:53:51 Re: Extensions, patch v20 (bitrot fixes)