Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2PDW-0001jA-Dr for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Jan 2021 01:56:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l2PDU-0004lp-Eu for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Jan 2021 01:56:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2PDT-0004li-JZ for pgsql-hackers@lists.postgresql.org; Thu, 21 Jan 2021 01:56:55 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2PDR-0002u8-GV for pgsql-hackers@lists.postgresql.org; Thu, 21 Jan 2021 01:56:54 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 10L1unws799341; Wed, 20 Jan 2021 20:56:49 -0500 From: Tom Lane To: Craig Ringer cc: Robert Haas , vignesh C , Andres Freund , Peter Eisentraut , PostgreSQL Hackers Subject: Re: Printing backtrace of postgres processes In-reply-to: References: <1778088.1606026308@sss.pgh.pa.us> <20201201032649.aekv5b5dicvmovf4@alap3.anarazel.de> <1361750.1606795285@sss.pgh.pa.us> <55526d79-247d-83a1-0961-7d42e0db1870@enterprisedb.com> <20210115201011.noomcygirzge43ir@alap3.anarazel.de> <3537.1610828491@sss.pgh.pa.us> <492025.1611078655@sss.pgh.pa.us> <523589.1611091371@sss.pgh.pa.us> Comments: In-reply-to Craig Ringer message dated "Thu, 21 Jan 2021 09:42:35 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <799339.1611194209.1@sss.pgh.pa.us> Date: Wed, 20 Jan 2021 20:56:49 -0500 Message-ID: <799340.1611194209@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Craig Ringer writes: > On Wed, 20 Jan 2021 at 05:23, Tom Lane wrote: >> BTW, it also looks like the patch is doing nothing to prevent the >> backtrace from being sent to the connected client. > I don't see a good reason to send a bt to a client. Even though these > backtraces won't be analysing debuginfo and populating args, locals, etc, > it should still just go to the server log. Yeah. That's easier than I was thinking, we just need to s/LOG/LOG_SERVER_ONLY/. >> Maybe, given all of these things, we should forget using elog at >> all and just emit the trace with fprintf(stderr). > That causes quite a lot of pain with MemoryContextStats() already True. Given the changes discussed in the last couple messages, I don't see any really killer reasons why we can't ship the trace through elog. We can always try that first, and back off to fprintf if we do find reasons why it's too unstable. regards, tom lane