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 5CA01665C0 for ; Thu, 7 Jan 2021 11:23:59 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4979E1B30D for ; Thu, 7 Jan 2021 11:23:29 +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) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id A0E9B1B300 for ; Thu, 7 Jan 2021 11:23:27 +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 67A984576C for ; Thu, 7 Jan 2021 11:23:27 +0100 (CET) Date: Thu, 7 Jan 2021 11:23:26 +0100 From: Wolfgang Bumiller To: Stefan Reiter Cc: pve-devel@lists.proxmox.com Message-ID: <20210107102326.mttrqn5su7ufnkcm@olga.proxmox.com> References: <20210104134914.20294-1-s.reiter@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210104134914.20294-1-s.reiter@proxmox.com> User-Agent: NeoMutt/20180716 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.050 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: [pve-devel] applied: [PATCH qemu] PVE: fix aborting multiple 'CREATED' jobs in sequential transaction X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2021 10:23:59 -0000 applied On Mon, Jan 04, 2021 at 02:49:14PM +0100, Stefan Reiter wrote: > Deadlocks could occur in the AIO_WAIT_WHILE loop in job_finish_sync, > which would wait for CREATED but not running jobs to complete, even > though job_enter is a no-op in that scenario. Mark offending jobs as > ABORTING immediately via job_update_rc if required. > > Manifested itself in cancelling or failing backups with more than 2 > drives. > > Signed-off-by: Stefan Reiter > --- > > Potential fix for #3225 and related forum threads: > https://forum.proxmox.com/threads/problem-mit-backup.80418/ > https://forum.proxmox.com/threads/vm-hard-freezes-on-backup.81752/ > > job.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/job.c b/job.c > index 97ee97a192..51984e557c 100644 > --- a/job.c > +++ b/job.c > @@ -1035,6 +1035,13 @@ int job_finish_sync(Job *job, void (*finish)(Job *, Error **errp), Error **errp) > return -EBUSY; > } > > + /* in a sequential transaction jobs with status CREATED can appear at time > + * of cancelling, these have not begun work so job_enter won't do anything, > + * let's ensure they are marked as ABORTING if required */ > + if (job->status == JOB_STATUS_CREATED && job->txn->sequential) { > + job_update_rc(job); > + } > + > AIO_WAIT_WHILE(job->aio_context, > (job_enter(job), !job_is_completed(job))); > > -- > 2.20.1