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 1pWMra-0004gP-Dp for pgsql-hackers@arkaria.postgresql.org; Sun, 26 Feb 2023 19:39:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pWMrY-0006Us-R4 for pgsql-hackers@arkaria.postgresql.org; Sun, 26 Feb 2023 19:39:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pWMrY-0006Uj-Eu for pgsql-hackers@lists.postgresql.org; Sun, 26 Feb 2023 19:39:12 +0000 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pWMrS-0007GO-9j for pgsql-hackers@lists.postgresql.org; Sun, 26 Feb 2023 19:39:11 +0000 Received: by mail-pg1-x530.google.com with SMTP id h31so2355483pgl.6 for ; Sun, 26 Feb 2023 11:39:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=yLKOAmMXAf9VTpi4wJ1SRfFZv8CG83hM3w1KMZutLIA=; b=KBIKdbYrIL4Ne/twA/g3lYd2RiWhcfjZCzgkXVE+9sKEPx2dYuiusezvLdsaQEXfOw 2FyTtRGCRRK0OmS8MYuppHEgDJcbNHhhj0qF5JRwgDrHtvDtoUWRBDKeofh4ry6txHdd Y3vSiD1dBEdcD/2hGti0L7rbNKdduAMMhZYmsp/4qRly4YtwOIpbzYK3S9scv5frVlUU uOE/8UM7mvowXX2FAP2RZvexAVIYOMz3idv9vIxH6MfTyaECmVFlpZ6oHC30aazjgEiI KR2Pvv3axCk/i5AfSQVwrk3hiG8Q+1jdQdBkV+12WqiodR2bj3lDByKXwE4EHG9h/mk/ bl7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=yLKOAmMXAf9VTpi4wJ1SRfFZv8CG83hM3w1KMZutLIA=; b=Gq64wEJAh8PJ0M3j695DlzmSl/i+s1LUYt3TWYyXrfzYH3XBzFJtdo/q81PYEWHau8 dfKAD3/ChebPGlJWQtpzOiBy1LzEzW/borMMtkiMqPfDZI39h61igj0IzK/MRWNtQRpK cUQpGNS6aiL2C7OM3zzXUPPQuhRP2W8tkSq3r6woYCw4vqTk36e6XWFcYbgXPypC2pmM uOMHIBsyN8JYk+14791LlBb7uGHeSucker93s6srU+HmnHKZlHkaAWdlY31xIUN8Zoei YGAPG40NlEzbzotTadUr/SG2ECp9OHbzHb67/XbGnwcyFpIiQTmwhUgMcg5DBICC0N2A 0wvw== X-Gm-Message-State: AO0yUKVtEeKwfBbe18/fQ+XwlmvBUxjI9xJmKNhPoS6IhWcLDqcjyenR DChTcF3Bhg4cfgwfGNqT+uk= X-Google-Smtp-Source: AK7set+D99S+WXvZj+VK9vSQ1oHmdiJo/Wnr/pSsy5b9Po/Rk4GJ+uEIdMpPn9CZ7L20GoBIS34hiA== X-Received: by 2002:a62:1816:0:b0:5e0:316a:20a4 with SMTP id 22-20020a621816000000b005e0316a20a4mr9209934pfy.25.1677440343572; Sun, 26 Feb 2023 11:39:03 -0800 (PST) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id j1-20020aa78d01000000b005dd65169623sm2757484pfe.190.2023.02.26.11.39.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 11:39:02 -0800 (PST) Date: Sun, 26 Feb 2023 11:39:00 -0800 From: Nathan Bossart To: Andres Freund Cc: Thomas Munro , Michael Paquier , Robert Haas , Tom Lane , Fujii Masao , Postgres hackers Subject: Re: stopgap fix for signal handling during restore_command Message-ID: <20230226193900.GA1248604@nathanxps13> References: <20230223231503.GA743455@nathanxps13> <20230224043323.GA821522@nathanxps13> <20230225190742.lfopue3nkrvxxoie@awork3.anarazel.de> <20230225192825.GA868928@nathanxps13> <20230225195253.hzp6pyllhn4kw4g6@awork3.anarazel.de> <20230225220629.GA1021641@nathanxps13> <20230226180029.djk7cth4o3o5doom@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230226180029.djk7cth4o3o5doom@awork3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Feb 26, 2023 at 10:00:29AM -0800, Andres Freund wrote: > On 2023-02-25 14:06:29 -0800, Nathan Bossart wrote: >> On Sat, Feb 25, 2023 at 11:52:53AM -0800, Andres Freund wrote: >> > I think I opined on this before, but we really ought to have a function to do >> > some minimal signal safe output. Implemented centrally, instead of being open >> > coded in a bunch of places. >> >> While looking around for the right place to put this, I noticed that >> there's a write_stderr() function in elog.c that we might be able to use. >> I used that in v9. WDYT? > > write_stderr() isn't signal safe, from what I can tell. *facepalm* Sorry. What precisely did you have in mind? AFAICT you are asking for a wrapper around write(). -- Nathan Bossart Amazon Web Services: https://aws.amazon.com