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 A7CFD61A99 for ; Fri, 18 Dec 2020 07:16:28 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 96EF92CD23 for ; Fri, 18 Dec 2020 07:15:58 +0100 (CET) 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 E3C9C2CD16 for ; Fri, 18 Dec 2020 07:15:57 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id AD937452E5 for ; Fri, 18 Dec 2020 07:15:57 +0100 (CET) Date: Fri, 18 Dec 2020 07:15:34 +0100 (CET) From: Dietmar Maurer To: Proxmox Backup Server development discussion , Dominik Csapak Message-ID: <700659272.1972.1608272135383@webmail.proxmox.com> In-Reply-To: <20201217143331.2407-1-d.csapak@proxmox.com> References: <20201217143331.2407-1-d.csapak@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.4-Rev14 X-Originating-Client: open-xchange-appsuite X-SPAM-LEVEL: Spam detection results: 0 AWL 0.112 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com] Subject: [pbs-devel] applied: [PATCH proxmox-backup] tools/process_locker: Decrement writer count in drop handler 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, 18 Dec 2020 06:16:28 -0000 applied > On 12/17/2020 3:33 PM Dominik Csapak wrote: > > > of ProcessLockSharedGuard. > > We use a counter to determine if we can unlock the file again, but > we never actually decremented the writer count, so we held the > lock forever. > > This fixes the issue that we could not start a garbage collect after > a reload, as long as the old process is still running, even when that > process has no active backup anymore but another long running task > (e.g. file download, terminal, etc.). > > Signed-off-by: Dominik Csapak > --- > src/tools/process_locker.rs | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/src/tools/process_locker.rs b/src/tools/process_locker.rs > index 56f8c514..6ab2e1c1 100644 > --- a/src/tools/process_locker.rs > +++ b/src/tools/process_locker.rs > @@ -55,7 +55,9 @@ impl Drop for ProcessLockSharedGuard { > if let Err(err) = nix::fcntl::fcntl(data.file.as_raw_fd(), nix::fcntl::FcntlArg::F_SETLKW(&op)) { > panic!("unable to drop writer lock - {}", err); > } > - data.writers = 0; > + } > + if data.writers > 0 { > + data.writers -= 1; > } > } > } > -- > 2.20.1 > > > > _______________________________________________ > pbs-devel mailing list > pbs-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel