From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 7D2427A14F for ; Thu, 6 May 2021 17:27:38 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0D0D322D99 for ; Thu, 6 May 2021 17:27:08 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id ED1D522D4D for ; Thu, 6 May 2021 17:27:04 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id C309C4650C for ; Thu, 6 May 2021 17:27:04 +0200 (CEST) From: Stefan Reiter To: pbs-devel@lists.proxmox.com Date: Thu, 6 May 2021 17:26:20 +0200 Message-Id: <20210506152624.12605-6-s.reiter@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210506152624.12605-1-s.reiter@proxmox.com> References: <20210506152624.12605-1-s.reiter@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.014 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [api.rs] Subject: [pbs-devel] [PATCH proxmox-backup 5/9] file-restore-daemon: work around tokio DuplexStream bug X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 May 2021 15:27:38 -0000 See this PR for more info: https://github.com/tokio-rs/tokio/pull/3756 As a workaround use a pair of connected unix sockets - this obviously incurs some overhead, albeit not measureable on my machine. Once tokio includes the fix we can go back to a DuplexStream for performance and simplicity. Signed-off-by: Stefan Reiter --- Thanks to @Wolfgang for helping debug this! src/bin/proxmox_restore_daemon/api.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bin/proxmox_restore_daemon/api.rs b/src/bin/proxmox_restore_daemon/api.rs index f1d601ce..5aeb69f3 100644 --- a/src/bin/proxmox_restore_daemon/api.rs +++ b/src/bin/proxmox_restore_daemon/api.rs @@ -275,7 +275,11 @@ fn extract( bail!("file or directory {:?} does not exist", path); } - let (mut writer, reader) = tokio::io::duplex(1024 * 64); + // FIXME: DuplexStream is currently broken and doesn't wake pending writers on close, i.e. + // this doesn't drop the WatchdogInhibitor if we encounter an error (client aborts, etc...) + // see: https://github.com/tokio-rs/tokio/pull/3756 + // let (mut writer, reader) = tokio::io::duplex(1024 * 64); + let (mut writer, reader) = tokio::net::UnixStream::pair()?; if pxar { tokio::spawn(async move { -- 2.20.1