Re: Pg stuck at 100% cpu, for multiple days

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: depesz(at)depesz(dot)com, pgsql-hackers mailing list <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Pg stuck at 100% cpu, for multiple days
Date: 2021-08-30 19:34:05
Message-ID: 20210830193405.GC26465@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 30, 2021 at 09:09:20PM +0200, Laurenz Albe wrote:
> On Mon, 2021-08-30 at 17:18 +0200, hubert depesz lubaczewski wrote:
> > The thing is - I can't close it with pg_terminate_backend(), and I'd
> > rather not kill -9, as it will, I think, close all other connections,
> > and this is prod server.
>
> Of course the cause should be fixed, but to serve your immediate need:

You might save a coredump of the process using gdb gcore before killing it, in
case someone thinks how to debug it next month.

Depending on your OS, you might have to do something special to get shared
buffers included in the dump (or excluded, if that's what's desirable).

I wonder how far up the stacktrace it's stuck ?
You could set a breakpoint on LogicalDecodingProcessRecord and then "c"ontinue,
and see if it hits the breakpoint in a few seconds. If not, try the next
frame until you know which one is being called repeatedly.

Maybe CheckForInterrupts should be added somewhere...

--
Justin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message alvherre@alvh.no-ip.org 2021-08-30 19:51:54 Re: archive status ".ready" files may be created too early
Previous Message Laurenz Albe 2021-08-30 19:09:20 Re: Pg stuck at 100% cpu, for multiple days