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 EB5D86C834 for ; Tue, 30 Mar 2021 09:19:02 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D5EDB1BDEB for ; Tue, 30 Mar 2021 09:18:32 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (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 D76FD1BDDE for ; Tue, 30 Mar 2021 09:18:31 +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 97DA14324A for ; Tue, 30 Mar 2021 09:18:31 +0200 (CEST) Date: Tue, 30 Mar 2021 09:18:29 +0200 (CEST) From: Wolfgang Bumiller To: Dietmar Maurer , Proxmox Backup Server development discussion , Dominik Csapak Message-ID: <1264854279.1499.1617088709235@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-Rev5 X-Originating-Client: open-xchange-appsuite X-SPAM-LEVEL: Spam detection results: 0 AWL 0.028 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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 pxar] encoder: flush after writing last entry 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: Tue, 30 Mar 2021 07:19:03 -0000 > On 03/30/2021 9:10 AM Dietmar Maurer wrote: > > > > After an off-list talk with Dominik we concluded that keeping it for `Owned` > > writers is the safer approach for the simple reason that in *async* code (eg. > > tokio's async BufWriter equivalent) you *do* need to flush buffered writers. > > > > This is probably because there's no `AsyncDrop` and there's no guarantee that > > the future's `Drop` handler is called in a place where it is safe to call > > tokio's `block_in_place` (after all it panics when it is outside a tokio RT > > thread, *including* being inside a `runtime.block_on()` called from outside > > a tokio RT thread). > > > > So yeah, let's not revert this, but limit it to `EncoderOutput::Owned`. > > But Flushing at every sub-dir makes no real sense. You only need > to flush once when you are finished writing the pxar (for the top level dir)? Yes, this is implicitly the case then because nested directories borrow the writer and therefor always use `EncoderOutput::Borrowed`. Only the top level has the `Owned` entry. (If this ever changes we can just track this with a boolean or something)