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 2ED6E9153C for ; Thu, 4 Apr 2024 10:49:09 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 08D8534689 for ; Thu, 4 Apr 2024 10:48:39 +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 for ; Thu, 4 Apr 2024 10:48:38 +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 C0445451D0 for ; Thu, 4 Apr 2024 10:48:37 +0200 (CEST) Date: Thu, 04 Apr 2024 10:48:31 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Christian Ebner , Proxmox Backup Server development discussion References: <20240328123707.336951-1-c.ebner@proxmox.com> <20240328123707.336951-7-c.ebner@proxmox.com> <1712136715.t3s03j6zyy.astroid@yuna.none> In-Reply-To: MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1712219065.g0jbnhpieg.astroid@yuna.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.059 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy 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 v3 pxar 06/58] encoder: move to stack based state tracking 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, 04 Apr 2024 08:49:09 -0000 On April 3, 2024 1:01 pm, Christian Ebner wrote: > On 4/3/24 11:54, Fabian Gr=C3=BCnbichler wrote: >>=20 >> should we still have some sort of checks here? e.g., when dropping an >> encoder, how should self.finished and self.state look like? IIUC, then a >> dropped encoder should have an empty state and be finished (i.e., >> `close()` has been called on it). >>=20 >> or is this simply not relevant anymore because we only create one and >> then drop it at the end (but should we then have a similar mechanism for >> EncoderState?) >=20 > The encoder should now be consumed with the `close` call, which takes=20 > ownership of the encoder and drops it afterwards, so all the state=20 > checks should happen there. >=20 > Previously, the encoder finish consumed the per-directory level encoder=20 > object, passing possible errors up to the parent implementation, which=20 > is not possible now since there is only one encoder instance. I did not=20 > want to panic here as the checks should be done in the close now, so the=20 > Drop implementation was removed. but now the equivalent is the EncoderState (which is per directory). > Not sure what to check in a Drop implementation the EncoderState. What=20 > did you have in mind for that? Note that errors get propagated to the=20 > parent state in the encoder finish calls now. well, basically that it is finished itself? i.e., in `finish` set a flag, and in the Drop handler check that it is set. right now this is the only place we `pop` the state from the state stack anyway, so it should be okay, but who knows what future refactors bring.