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 60EE5660A8 for ; Tue, 5 Jan 2021 10:52:14 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5669B26C71 for ; Tue, 5 Jan 2021 10:52:14 +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 4A06626C63 for ; Tue, 5 Jan 2021 10:52:13 +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 19D9642F1B for ; Tue, 5 Jan 2021 10:52:13 +0100 (CET) To: pve-devel@lists.proxmox.com References: <20210104134914.20294-1-s.reiter@proxmox.com> From: Mira Limbeck Message-ID: <9a792506-5baf-00cb-0ed7-bdd064f61ce5@proxmox.com> Date: Tue, 5 Jan 2021 10:52:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210104134914.20294-1-s.reiter@proxmox.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-SPAM-LEVEL: Spam detection results: 0 AWL 0.454 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) 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: Re: [pve-devel] [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: Tue, 05 Jan 2021 09:52:14 -0000 Tested Stefan's prebuilt qemu package with this patch applied and my VM that has the issue. Additionally tested the case of a full backup target (https://forum.proxmox.com/threads/vm-hard-freezes-on-backup.81752/) and it no longer hangs. Looks good in my tests, so: Tested-by: Mira Limbeck On 1/4/21 2:49 PM, 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))); >