Re: Pg stuck at 100% cpu, for multiple days - Mailing list pgsql-hackers

From Justin Pryzby
Subject Re: Pg stuck at 100% cpu, for multiple days
Date
Msg-id 20210830193405.GC26465@telsasoft.com
Whole thread Raw
In response to Re: Pg stuck at 100% cpu, for multiple days  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: Pg stuck at 100% cpu, for multiple days  (Joe Conway <mail@joeconway.com>)
List 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



pgsql-hackers by date:

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