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 27F4B7A3CC for ; Fri, 7 May 2021 09:27:00 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1BE30276D0 for ; Fri, 7 May 2021 09:27:00 +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 25CC7276C5 for ; Fri, 7 May 2021 09:26:59 +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 E2D974650C for ; Fri, 7 May 2021 09:26:58 +0200 (CEST) Date: Fri, 07 May 2021 09:26:51 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox Backup Server development discussion , Stefan Reiter , Thomas Lamprecht References: <20210506152624.12605-1-s.reiter@proxmox.com> <20210506152624.12605-6-s.reiter@proxmox.com> <07c15982-0adb-d3b6-02c3-560969df1779@proxmox.com> In-Reply-To: <07c15982-0adb-d3b6-02c3-560969df1779@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.15.0 (https://github.com/astroidmail/astroid) Message-Id: <1620372217.h78x1o48e9.astroid@nora.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.024 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: Re: [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: Fri, 07 May 2021 07:27:00 -0000 On May 6, 2021 8:12 pm, Thomas Lamprecht wrote: > On 06.05.21 17:26, Stefan Reiter wrote: >> See this PR for more info: https://github.com/tokio-rs/tokio/pull/3756 >>=20 >> 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. >>=20 >=20 > now that it got merged, do we want to cherry-pick this or await inclusion > in stable instead of applying this workaround? >=20 > CC'ing Fabian as our tokio (or better said rust) packaging wizard we can A) use this workaround, and switch back once a fixed tokio version is=20 available B) cherry-pick the fix into our tokio package, not use this workaround,=20 package and bump dependency ASAP once a tokio version with the fix is=20 available A has the advantage of not (subtly) breaking third-party builds that use=20 crates from crates.io, but requires us to remember switching back once=20 the fix is available. B has the advantage that we don't have to=20 remember anything, since we'll update tokio sooner or later anyway ;) both is fine for me, cherry-picking is about 10 minutes worth of work=20 so.. >=20 >> Signed-off-by: Stefan Reiter >> --- >>=20 >> Thanks to @Wolfgang for helping debug this! >>=20 >> src/bin/proxmox_restore_daemon/api.rs | 6 +++++- >> 1 file changed, 5 insertions(+), 1 deletion(-) >>=20 >> diff --git a/src/bin/proxmox_restore_daemon/api.rs b/src/bin/proxmox_res= tore_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); >> } >> =20 >> - let (mut writer, reader) =3D tokio::io::duplex(1024 * 64); >> + // FIXME: DuplexStream is currently broken and doesn't wake pen= ding writers on close, i.e. >> + // this doesn't drop the WatchdogInhibitor if we encounter an e= rror (client aborts, etc...) >> + // see: https://github.com/tokio-rs/tokio/pull/3756 >> + // let (mut writer, reader) =3D tokio::io::duplex(1024 * 64); >> + let (mut writer, reader) =3D tokio::net::UnixStream::pair()?; >> =20 >> if pxar { >> tokio::spawn(async move { >>=20 >=20 >=20 =