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 9CA327B484 for ; Wed, 12 May 2021 10:01:17 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8B4F9A0F2 for ; Wed, 12 May 2021 10:01:17 +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 0C6EBA0E3 for ; Wed, 12 May 2021 10:01:16 +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 A10B346191 for ; Wed, 12 May 2021 10:01:16 +0200 (CEST) Date: Wed, 12 May 2021 10:00:55 +0200 (CEST) From: Wolfgang Bumiller To: Dietmar Maurer , Proxmox Backup Server development discussion Message-ID: <1724370635.2142.1620806455083@webmail.proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v7.10.5-Rev10 X-Originating-Client: open-xchange-appsuite X-SPAM-LEVEL: Spam detection results: 0 AWL 0.018 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 Subject: Re: [pbs-devel] [PATCH backup 5/7] proxy: implement 'reload-certificate' command 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: Wed, 12 May 2021 08:01:17 -0000 > On 05/12/2021 9:42 AM Dietmar Maurer wrote: > > > Stupid questzioon, but why cant we do: > > diff --git a/src/bin/proxmox-backup-proxy.rs b/src/bin/proxmox-backup-proxy.rs > index fc773459..29298a22 100644 > --- a/src/bin/proxmox-backup-proxy.rs > +++ b/src/bin/proxmox-backup-proxy.rs > @@ -223,7 +223,6 @@ async fn accept_connection( > // Note that these must not be moved out/modified directly, they get pinned in the loop and > // "rearmed" after waking up: > let mut reload_tls = notify_tls_cert_reload.notified(); > - let mut accept = listener.accept(); > > loop { > let sock; > @@ -231,7 +230,9 @@ async fn accept_connection( > // normally we'd use `tokio::pin!()` but we need this to happen outside the loop and we > // need to be able to "rearm" the futures: > let reload_tls_pin = unsafe { Pin::new_unchecked(&mut reload_tls) }; > - let accept_pin = unsafe { Pin::new_unchecked(&mut accept) }; > + //let accept_pin = unsafe { Pin::new_unchecked(&mut accept) }; > + let accept = listener.accept(); > + For the `accept` call this can even work, but not for the notify one (won't compile), which is a bit weird, since looking up the Notify code, it *does* have code in the Drop handler to forward wakeups in case it gets dropped before being received, however, both need to have correct code to handle this somehow, and I felt like dropping and requerying is less "nice" and allows for more "weird" errors (similar to the DuplexStream issue) happening, and I didn't feel comfortable leaving more room for our main client accept loop to end up in an unexplained "hanging" state somehow. (I have trust issues sometimes...) But sure, we could do this for accept. (With the patch set I just sent out that would just need the Box::pin() calls removed) I wish there was some nice form of a `select_loop!`-like helper...