Search Postgresql Archives

Re: Kill -9 for a session process caused all the sessions to be killed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 23/09/2010 12:26 AM, Atul.Goel@xxxxxxxxxxxxxxxxxxx wrote:
Hi All,

I by mistake ran a query to update a huge table with around 500000 rows
and has to kill the session.

I found the process-id from the query select * from pg_stat_activity.

I killed the process using Kill -9 process_id.

Why kill -9 (SIGKILL)?

Did it not respond to regular SIGTERM (the default for kill) ?

SIGKILL will forcibly terminate a process, with no chance for the process to flush any half-written buffers, tell other processes it is being killed, etc. In a system of co-operating processes like the PostgreSQL server, this is bad.

As per the manual, you should not "kill -9" a backend.

For that matter, you should not as a sysadmin "kill -9" (SIGKILL) any process at all, unless it fails to respond to SIGTERM after a few seconds (or longer) and letting it finish whatever it's doing isn't an option. SIGKILL is a really big hammer.

--
Craig Ringer

Tech-related writing at http://soapyfrogs.blogspot.com/

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux