Re: backend hangs at immediate shutdown - Mailing list pgsql-hackers

From Tom Lane
Subject Re: backend hangs at immediate shutdown
Date
Msg-id 8144.1359592798@sss.pgh.pa.us
Whole thread Raw
In response to Re: backend hangs at immediate shutdown  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: backend hangs at immediate shutdown
Re: backend hangs at immediate shutdown
List pgsql-hackers
Andres Freund <andres@2ndquadrant.com> writes:
> On 2013-01-31 08:27:13 +0900, Tatsuo Ishii wrote:
>> What about adding a caution to the doc something like:
>> "pg_ctl -m -i stop" may cause a PostgreSQL hang if native laguage support enabled.

> That doesn't entirely solve the problem, see quote and reply in
> 6845.1359561252@sss.pgh.pa.us

> I think adding errmsg_raw() or somesuch that doesn't allocate any memory
> and only accepts constant strings could solve the problem more
> completely, at the obvious price of not allowing translated strings
> directly.

I really doubt that this would make a measurable difference in the
probability of failure.  The OP's case looks like it might not have
occurred if we weren't translating, but (a) that's not actually proven,
and (b) there are any number of other, equally low-probability, reasons
to have a problem here.  Please note for instance that elog.c would
still be doing a whole lot of palloc's even if the passed strings were
not copied.

I think if we want to make it bulletproof we'd have to do what the
OP suggested and switch to SIGKILL.  I'm not enamored of that for the
reasons I mentioned --- but one idea that might dodge the disadvantages
is to have the postmaster wait a few seconds and then SIGKILL any
backends that hadn't exited.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: backend hangs at immediate shutdown
Next
From: Tatsuo Ishii
Date:
Subject: Re: backend hangs at immediate shutdown