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 1n98UW-0006s3-QI for pgsql-hackers@arkaria.postgresql.org; Sun, 16 Jan 2022 16:34:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n98UV-0001u4-N2 for pgsql-hackers@arkaria.postgresql.org; Sun, 16 Jan 2022 16:34:51 +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 1n98UV-0001tu-DV for pgsql-hackers@lists.postgresql.org; Sun, 16 Jan 2022 16:34:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n98US-00007L-Ev for pgsql-hackers@postgresql.org; Sun, 16 Jan 2022 16:34:51 +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 20GGYgkT3703647; Sun, 16 Jan 2022 11:34:43 -0500 From: Tom Lane To: Andres Freund cc: pgsql-hackers@postgresql.org, Magnus Hagander Subject: Re: pg_basebackup WAL streamer shutdown is bogus - leading to slow tests In-reply-to: <20220116092207.me3kihxgjcbyshae@alap3.anarazel.de> References: <20220116092207.me3kihxgjcbyshae@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Sun, 16 Jan 2022 01:22:07 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3703645.1642350882.1@sss.pgh.pa.us> Date: Sun, 16 Jan 2022 11:34:42 -0500 Message-ID: <3703646.1642350882@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > I don't immediately see a solution for this, other than to add > StreamCtl->stop_event (mirroring ->stop_socket) and then convert > CopyStreamPoll() to use WaitForMultipleObjects(). Microsoft's select() > doesn't support pipes and there's no socketpair(). > Any more straightforward ideas? > From a cursory look at history, it used to be that pg_basebackup had this > behaviour on all platforms, but it got fixed for other platforms in > 7834d20b57a by Tom (assuming the problem wasn't present there). Hmm --- I see that I thought Windows was unaffected, but I didn't consider this angle. Can we send the child process a signal to kick it off its wait? regards, tom lane