Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPx5i-0002nU-4d for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Jun 2017 20:28:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dPx5h-0005Jo-Kh for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Jun 2017 20:28:05 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dPx45-0008BH-Tz for pgsql-hackers@postgresql.org; Tue, 27 Jun 2017 20:26:26 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dPx3y-0002Du-US for pgsql-hackers@postgresql.org; Tue, 27 Jun 2017 20:26:24 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v5RKQFic020872; Tue, 27 Jun 2017 16:26:15 -0400 From: Tom Lane To: Andres Freund cc: Jeff Janes , Michael Paquier , PostgreSQL mailing lists Subject: Re: Reducing pg_ctl's reaction time In-reply-to: <20170627200544.2czwjtdtyy4gr4sv@alap3.anarazel.de> References: <18890.1498508760@sss.pgh.pa.us> <20170626203347.6efkdwiadyt33edy@alap3.anarazel.de> <19812.1498510147@sss.pgh.pa.us> <20170626205853.ezhnmxpotdy3wokm@alap3.anarazel.de> <15166.1498512630@sss.pgh.pa.us> <20170626213414.ejcesidei2hv4h5x@alap3.anarazel.de> <15732.1498513083@sss.pgh.pa.us> <20170626215018.2fudv2aha5rkkg4r@alap3.anarazel.de> <17327.1498515236@sss.pgh.pa.us> <15323.1498589958@sss.pgh.pa.us> <20170627200544.2czwjtdtyy4gr4sv@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Tue, 27 Jun 2017 13:05:44 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20870.1498595175.1@sss.pgh.pa.us> Date: Tue, 27 Jun 2017 16:26:15 -0400 Message-ID: <20871.1498595175@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Andres Freund writes: > On 2017-06-27 14:59:18 -0400, Tom Lane wrote: >> If we decide that it has to wait for v11, >> I'd address Jeff's complaint by hacking the loop behavior in >> test_postmaster_connection, which'd be ugly but not many lines of code. > Basically increasing the wait time over time? I was thinking of just dropping back to once-per-second after a couple of seconds, with something along the lines of this in place of the existing sleep at the bottom of the loop: if (i >= 2 * WAITS_PER_SEC) { pg_usleep(USEC_PER_SEC); i += WAITS_PER_SEC - 1; } else pg_usleep(USEC_PER_SEC / WAITS_PER_SEC); > The 8-space thing in multiple places is a bit ugly. How about having a > a bunch of constants declared in one place? Alternatively make it > something like: status: $c, where $c is a one character code for the > various states? Yeah, we could add the string values as macros in miscadmin.h, perhaps. I don't like the single-character idea --- if we do expand the number of things reported this way, that could get restrictive. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers