Re: Kill postgresql process

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: abbas alizadeh <ramkly(at)yahoo(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Kill postgresql process
Date: 2021-06-14 16:15:35
Message-ID: 37bda3bc33a441557fd658afc5dfbf3000f06d49.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Julien Rouhaud 2021-06-14 16:25:23 Re: Kill postgresql process
Previous Message Julien Rouhaud 2021-06-14 15:49:08 Re: Kill postgresql process