Re: Kill postgresql process - Mailing list pgsql-admin

From Laurenz Albe
Subject Re: Kill postgresql process
Date
Msg-id 37bda3bc33a441557fd658afc5dfbf3000f06d49.camel@cybertec.at
Whole thread Raw
In response to Kill postgresql process  (abbas alizadeh <ramkly@yahoo.com>)
Responses Re: Kill postgresql process
List pgsql-admin
On Mon, 2021-06-14 at 23:41 +0800, abbas alizadeh wrote:
> How we can kill the stuck process?
> The process didn’t kill by pg_cancel_backend/pg_terminate_backend.
> Is there any way beside of using “kill -9” or “pg_ctl kill ABRT” ?

If you don't mind a little hackery, I found a simple way to
terminate backends that don't react to interrupts that avoids
"kill -9" and the ensuing crash recovery:

- Attach to the backend with gdb.
- Enter "print ProcessInterrupts()"

Of course that will not work if the backend is in uninterruptible
sleep (for example, stuck in an I/O operation).

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




pgsql-admin by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: Kill postgresql process
Next
From: Julien Rouhaud
Date:
Subject: Re: Kill postgresql process