Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TbCiD-0000Tn-7G for pgsql-bugs@postgresql.org; Wed, 21 Nov 2012 15:59:41 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TbCiC-0002Yz-4c for pgsql-bugs@postgresql.org; Wed, 21 Nov 2012 15:59:40 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id qALFxIRs004661; Wed, 21 Nov 2012 10:59:19 -0500 (EST) From: Tom Lane To: Hari Babu cc: pgsql-bugs@postgresql.org Subject: Re: BUG #7643: Issuing a shutdown request while server startup leads to server hang In-reply-to: <003201cdc7ec$982ae650$c880b2f0$@kommi@huawei.com> References: <10253.1353353527@sss.pgh.pa.us> <005201cdc6d7$fb988f00$f2c9ad00$@kommi@huawei.com> <14768.1353445229@sss.pgh.pa.us> <003201cdc7ec$982ae650$c880b2f0$@kommi@huawei.com> Comments: In-reply-to Hari Babu message dated "Wed, 21 Nov 2012 19:02:03 +0530" Date: Wed, 21 Nov 2012 10:59:18 -0500 Message-ID: <4660.1353513558@sss.pgh.pa.us> X-Pg-Spam-Score: -2.2 (--) X-Archive-Number: 201211/171 X-Sequence-Number: 34729 Hari Babu writes: > I have a query regarding the changing of pmState only incase of SIGTERM but > not incase of SIGINT. > Is there any reason to handle like this? or Is it ok to modify the handling > of pmState in SIGTERM same as SIGINT? AFAICT the "smart shutdown" code path is okay: it transitions to PM_WAIT_READONLY state, and then PostmasterStateMachine issues SIGTERM to the startup process and goes to PM_WAIT_BACKENDS state. Perhaps this could be done more clearly but I'm disinclined to mess with it. regards, tom lane