Skip site navigation (1) Skip section navigation (2)

pgsql: Avoid calling kill() in a postmaster signal handler.

From: alvherre(at)postgresql(dot)org (Alvaro Herrera)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Avoid calling kill() in a postmaster signal handler.
Date: 2009-08-24 17:23:17
Message-ID: 20090824172317.2908D75331E@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Avoid calling kill() in a postmaster signal handler.

This causes problems when the system load is high, per report from Zdenek 
Kotala in <1250860954(dot)1239(dot)114(dot)camel(at)localhost>; instead of calling kill
directly, have the signal handler set a flag which is checked in ServerLoop.
This way, the handler can return before being called again by a subsequent
signal sent from the autovacuum launcher.  Also, increase the sleep in the
launcher in this failure path to 1 second.  
  
Backpatch to 8.3, which is when the signalling between autovacuum
launcher/postmaster was introduced.
  
Also, add a couple of ReleasePostmasterChildSlot calls in error paths; this
part backpatched to 8.4 which is when the child slot stuff was introduced.

Tags:
----
REL8_4_STABLE

Modified Files:
--------------
    pgsql/src/backend/postmaster:
        autovacuum.c (r1.99 -> r1.99.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/autovacuum.c?r1=1.99&r2=1.99.2.1)
        postmaster.c (r1.583.2.3 -> r1.583.2.4)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/postmaster.c?r1=1.583.2.3&r2=1.583.2.4)

pgsql-committers by date

Next:From: Alvaro HerreraDate: 2009-08-24 17:23:29
Subject: pgsql: Avoid calling kill() in a postmaster signal handler.
Previous:From: Alvaro HerreraDate: 2009-08-24 17:23:02
Subject: pgsql: Avoid calling kill() in a postmaster signal handler.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group