From nobody Fri Apr 26 20:50:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1669196193; cv=none; d=zohomail.com; s=zohoarc; b=RdBbJ7AlV8p0YCeUzxiRQio6E7z3nf0wtQU89dHJ7ZHlqbC/e9vnuEpRKcghV5xD+ZuisaxFrpxoTHEy66XbxTjRmQq9XFaIHUa3kal0dMNuiy+znpnHXi/I4eAF7kXPQ9yA5aDw0JqDqeRkwzVmby4bTMVenlma8pnpwAeHZgs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1669196193; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=DiVrnwjPcZxvwaVn8R1DijWq77uNAWIoR8odS/PFSo4=; b=RDGWjIHiq3KIwXvRypOJOyIV21VqLs677SXFyxgUrkWOXmUfLk9Z5Dsm4ohzlQ0wCr1zbghoPI0HMnWmfHrn/MEo19txdzVmaCx/dr9wE3ta8Mer+xJ75t36bm2Ldfitr5rC3c/AYZlbeCpM8vBhsXXazbJZxZW9gIPINs9FA0g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1669196193593796.531491538758; Wed, 23 Nov 2022 01:36:33 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-508-6us-KBhYMA-0Svl8B8Z8qg-1; Wed, 23 Nov 2022 04:36:31 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C34143C0E213; Wed, 23 Nov 2022 09:36:28 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0FD1D2166B26; Wed, 23 Nov 2022 09:36:27 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B64561946589; Wed, 23 Nov 2022 09:36:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 065C51946589 for ; Wed, 23 Nov 2022 09:36:18 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 07834492B0E; Wed, 23 Nov 2022 09:36:13 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id A07A6492B0C for ; Wed, 23 Nov 2022 09:36:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669196192; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=DiVrnwjPcZxvwaVn8R1DijWq77uNAWIoR8odS/PFSo4=; b=WkTG7pS89Efq+giW9rAn4VOJZUKzYW8hB4XYH7/+N/KmDJ5GB8RPLHyFveblrB/eaUUmJY XQPAVi0RZXKxGjc1cRpEIPtigfZ0fDw3yKkGNsZH3x+u/Jv4nUre4yCNox3SxV4HC0hjgS Ylkh4TDJPcXYVqfRzDEtYKwZ3qqz0tw= X-MC-Unique: 6us-KBhYMA-0Svl8B8Z8qg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] rpc: Mark close callback (un-)register as high priority Date: Wed, 23 Nov 2022 10:35:59 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1669196195215100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Our RPC calls can be divided into two groups: regular and high priority. The latter can be then processed by so called high priority worker threads. This is our way of defeating a 'deadlock' and allowing some RPCs to be processed even when all (regular) worker threads are stuck. For instance: if all regular worker threads get stuck when talking to QEMU on monitor, the virDomainDestroy() can be processed by a high priority worker thread(s) and thus unstuck those threads. Now, this is all fine, except if users want to use virsh non interactively: virsh destroy $dom This does a bit more - it needs to open a connection. And that consists of multiple RPC calls: AUTH_LIST, CONNECT_SUPPORTS_FEATURE, CONNECT_OPEN, and finally CONNECT_REGISTER_CLOSE_CALLBACK. All of them are marked as high priority except the last one. Therefore, virsh just sits there with a partially open connection. There's one requirement for high priority calls though: they can not get stuck. Hopefully, the reason is obvious by now. And looking into the server side implementation the CONNECT_REGISTER_CLOSE_CALLBACK processing can't ever get stuck. The only driver that implements the callback for public API is Parallels (vz). And that can't block really. And for virConnectUnregisterCloseCallback() it's the same story. Therefore, both can be marked as high priority. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2143840 Signed-off-by: Michal Privoznik Reviewed-by: Daniel P. Berrang=C3=A9 --- src/remote/remote_protocol.x | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index 79ffc63f03..7dfb4548f4 100644 --- a/src/remote/remote_protocol.x +++ b/src/remote/remote_protocol.x @@ -6416,12 +6416,14 @@ enum remote_procedure { =20 /** * @generate: none + * @priority: high * @acl: connect:getattr */ REMOTE_PROC_CONNECT_REGISTER_CLOSE_CALLBACK =3D 360, =20 /** * @generate: none + * @priority: high * @acl: connect:getattr */ REMOTE_PROC_CONNECT_UNREGISTER_CLOSE_CALLBACK =3D 361, --=20 2.37.4