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 1pK9yq-00060d-8O for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Jan 2023 03:28:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pK9yp-00076x-8v for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Jan 2023 03:28:15 +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 1pK9yo-00073k-Vt for pgsql-hackers@lists.postgresql.org; Tue, 24 Jan 2023 03:28:14 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pK9yi-0000KD-R2; Tue, 24 Jan 2023 03:28:14 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id B02455C01F6; Mon, 23 Jan 2023 22:28:07 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 23 Jan 2023 22:28:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1674530887; x=1674617287; bh=enWQWSADIF 6DwOVNi2Gg2pGaL1bXnTsU8l8x9aFOPXM=; b=L5LjQgliO0ryebZ6sjdhn8IWJn XTLzAg2jf37YzfKuccm5LUUIm0QgOcc7ViHsG46OwAxqDazS8bcEHTJ5lFAxOUSC b9lkYRn2DImTFx/qg1sx/qk2eQjPKPVvCqaDw9tuueTkTnlGJHQaF4CGbDhCfDl3 rQKcueo1zsJ6/cXS0OACtGWfAY9k0HwiJhoIoDI3VK8+7U6te0RVuSLKt24BC68M gFOBywtE8vwmrAgfT50e5lqWOO0xN8vz3MtJ/xt2/2NlUcHE8K1nuu4ZhvkqtmEU AhHeL0StLlmdUxR3BoQKdxnfHK59RtDUZqN266hWfriI9dk7r0EQ8yQqDTVg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1674530887; x=1674617287; bh=enWQWSADIF6DwOVNi2Gg2pGaL1bX nTsU8l8x9aFOPXM=; b=i7yIEzkp7+hzHDYKj0fAnauLgKn9P8BSUQGoZRdextrW QdgT2cQvDNpbgEMM1bRMP+w8NSK09P2XCICM5qYO28MBNW6JE/HS14uc87Em8ORR 7gYS46DmfdAIAfW3moDDmpky0n2jHI+2FgaSXircUOprlU/k0KAXgQoeuTOCgfkY QHTO//Sy4ssAKmkhIHLaqFieT9cB5at4c2ZSDAokO7wKzqklwe2p3JFpru/MTVLj WyHdXp80OoeqoX0Ik8HUM4RA5oz5Vl9y0JYrjMc0awWsHoG/UM0guCs7+Syo5/wQ 3Y0ZbwyEH8a7NpGHZn+p2cRdH1+rScxJ0M6BDvNocQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudduledgieduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnhepvdfffeevhfetveffgeeiteefhfdtvdffjeevhfeuteegleduheetvedu ieettddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 23 Jan 2023 22:28:07 -0500 (EST) Date: Mon, 23 Jan 2023 19:28:06 -0800 From: Andres Freund To: Thomas Munro Cc: pgsql-hackers@postgresql.org, Robert Haas , Peter Geoghegan , Tom Lane , Fujii Masao , Bharath Rupireddy Subject: Re: postgres_fdw uninterruptible during connection establishment / ProcSignalBarrier Message-ID: <20230124032806.qwz6xja4c5cshm3j@awork3.anarazel.de> References: <20220925232237.p6uskba2dw6fnwj2@awork3.anarazel.de> <20221209020815.wsoixct72c6hst5l@awork3.anarazel.de> <20221229172330.jpuoljhtvivci3cd@awork3.anarazel.de> <20221229215437.s4q5lu6ijb67jugx@awork3.anarazel.de> <20230103200520.di5hjebqvi72coql@awork3.anarazel.de> <20230110020501.bujiesmhe2fuka42@awork3.anarazel.de> <20230121030008.acoon7nk7gnuslx4@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230121030008.acoon7nk7gnuslx4@awork3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2023-01-20 19:00:08 -0800, Andres Freund wrote: > Updated patch attached. I split it into multiple pieces. > 1) A fix for [1], included here because I encountered it while testing > 2) Introduction of libpq-be-fe-helpers.h > 3) Convert dblink and postgres_fdw to the helper > 4) Convert libpqwalreceiver.c to the helper > > Even if we eventually decide to backpatch 3), we'd likely not backpatch 4), as > there's no bug (although perhaps the lack of FD handling could be called a > bug?). > > There's also some light polishing, improving commit message, comments and > moving some internal helper functions to later in the file. After a tiny bit further polishing, and after separately pushing a resource leak fix for walrcv_connect(), I pushed this. Greetings, Andres Freund