pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Schnur <dnschnur@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Shutdown fails with both 'fast' and 'immediate'
Date: Wed, 12 May 2010 13:16:13 -0400
Message-ID: <22516.1273684573@sss.pgh.pa.us> (raw)
In-Reply-To: <AANLkTilzcY_VGBiYdTJ2bomtECxJxipSyW4AcpLMsO76@mail.gmail.com>
References: <AANLkTindCeLyRmRbgV4ICxEBGRLwyBbm5yO2oLBHUnSc@mail.gmail.com>
	<4652.1273674753@sss.pgh.pa.us>
	<AANLkTilzcY_VGBiYdTJ2bomtECxJxipSyW4AcpLMsO76@mail.gmail.com>

David Schnur <dnschnur@gmail.com> writes:
> I'm less concerned with the particular query than with the general question
> of when a shutdown could hang like this.  I expected this to be possible
> when using -m fast, but my understanding was that -m immediate really forced
> termination.

Yeah, it's supposed to.  The sequence is pg_ctl -m immediate sends
SIGQUIT to the postmaster, which in turn sends SIGQUIT to all its child
processes, and their SIGQUIT interrupt handlers just immediately exit().
I was thinking earlier that there might be a bug in the postmaster state
machine that prevented it from sending SIGQUIT if it had already
received SIGTERM (-m fast), but a look at the sources doesn't support
that theory.  The only obvious theory at this point is that the backend
is stuck in some uninterruptable kernel call, but it's hard to imagine
what.

Is the postmaster still there after -m immediate, or does it quit?
If it's still there, maybe there's some problem in the earlier part
of the sequence.

A gdb stack trace from whichever processes are still there after -m
immediate could be informative.  Another thing you could try is a
manual "kill -QUIT pid" on the uncooperative backend(s).

			regards, tom lane



view thread (7+ messages)  latest in thread

Message-ID: <22516.1273684573@sss.pgh.pa.us>
Permalink:  ../22516.1273684573@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22516.1273684573@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dnschnur@gmail.com
  Subject: Re: Shutdown fails with both 'fast' and 'immediate'
  In-Reply-To: <22516.1273684573@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox