Re: PG_TERMINATE_BACKEND not working. - Mailing list pgsql-general

From dinesh kumar
Subject Re: PG_TERMINATE_BACKEND not working.
Date
Msg-id CALnrH7o0O6r4KQ-X9NJubpy8q901MoJaVqB_9U_c38ErdzQjow@mail.gmail.com
Whole thread Raw
In response to Re: PG_TERMINATE_BACKEND not working.  (Raghavendra <raghavendra.rao@enterprisedb.com>)
List pgsql-general
Hi Harry, 

As you reported "pg_terminate_backend(pid)" returning "f" when executing. Please confirm are u getting any error like below .

postgres=# select pg_terminate_backend(342033);
WARNING:  PID 342033 is not a PostgreSQL server process
 pg_terminate_backend 
----------------------
 f
(1 row)

Not sure, what kind of error your are getting while executing it. So, requesting you to share your postgresql version, command what you have executed and it's result. However, pg_terminate_backend() is responsible to send "SIGTERM"  to it's OS process. From there onwards, OS will take care about the given process termination.

Can you give a try, by picking the IP's of the processes which are not getting killed from pg_stat_activity(client_addr column) and make REJECT entries in pg_hba.conf file as below:

host   all   all  <client_addr IP>   reject

and reload the cluster using pg_ctl -D $PGDATA reload

Now try killing the process 

pg_ctl kill TERM  <Process PID>
 
I am not sure why we are rejecting the incoming connections here. 

Regards,

pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: flush buffer after connection disllowed
Next
From: r d
Date:
Subject: Request for help setting up source tree