From nobody Wed Feb 11 06:32:23 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1613136372; cv=none; d=zohomail.com; s=zohoarc; b=nKEYtT2NtJKnb64SPl375f0DlefX0hHrBXGAuhkh6tG4RFnSdmsnDJcjwVexflnRgKZLxszVm0gIjsFgn0nUtxWrjKQEgAxiFPJCmtvP09IZSbTJ4SMErX/t6QYtI6KrUbMxthOagDalaUThT+TQZu3q4EqskSGlhAqc/RsHRbU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613136372; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YqckMi8qH2vQJ6UznLqZZnsRTunq04SPcjpWb2zwhL4=; b=XGY4H2P9Ymv0fVRpxat96EJGcT9dZe1xEbQPi4jgDp6YZ2JavTXKtjW3f2PWrQluy35+Y2ZVfUekfP8q0S9nCBZY/+2lNv85l1hqqf4GKMetZ14ppPa5D2aQcPUBLGBK5+p11/GEVjgDSiWsrYdVJPNfhMFHOsdgSEbHdU0MP4k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1613136372452893.7399478239679; Fri, 12 Feb 2021 05:26:12 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-579-1H6mRgOoPTm-bDbMco1nBw-1; Fri, 12 Feb 2021 08:26:07 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 14F1C80197A; Fri, 12 Feb 2021 13:26:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E39AA5C23D; Fri, 12 Feb 2021 13:26:00 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id AE6443805; Fri, 12 Feb 2021 13:26:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 11CDPhYN008632 for ; Fri, 12 Feb 2021 08:25:43 -0500 Received: by smtp.corp.redhat.com (Postfix) id C8EA36B8E5; Fri, 12 Feb 2021 13:25:43 +0000 (UTC) Received: from work.redhat.com (ovpn-112-223.ams2.redhat.com [10.36.112.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1DB63648A8; Fri, 12 Feb 2021 13:25:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613136371; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=YqckMi8qH2vQJ6UznLqZZnsRTunq04SPcjpWb2zwhL4=; b=ZtGusGTzfIGE2uLmvycrqlVJZQE0IvHC/V9IFPjz8iRgpsC51Uc7Ej97b/ZgP9ZyIQKRdf OTzuqU3ZDQFQbYH77tsAgEa/GjARdCbE1MB/2duYkDXODq2yaImOsvVPJ2lJFPi8+VRWF/ rbFeq2W0pCVLgkVZKREYK1RZ8V17JHw= X-MC-Unique: 1H6mRgOoPTm-bDbMco1nBw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 05/10] clang-tidy: Add timeout Date: Fri, 12 Feb 2021 14:25:29 +0100 Message-Id: <20210212132534.29066-6-twiederh@redhat.com> In-Reply-To: <20210212132534.29066-1-twiederh@redhat.com> References: <20210212132534.29066-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Defining a custom timeout allows the scan to finish (albeit unsuccessfully) before GitLab's 60 minute limit and thus preserve the cache of already scanned files. A successive run, e.g. when the "rerun" button in GitLab's web interface is clicked, roughly picks up where the previous run stopped, gradually increas= ing the amount of cached results and eventually succeeds. Signed-off-by: Tim Wiederhake --- scripts/run-clang-tidy.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/run-clang-tidy.py b/scripts/run-clang-tidy.py index cc9c20ea32..19b8640982 100755 --- a/scripts/run-clang-tidy.py +++ b/scripts/run-clang-tidy.py @@ -51,6 +51,11 @@ def parse_args(): "--cache", dest=3D"cache", help=3D"Path to cache directory") + parser.add_argument( + "--timeout", + dest=3D"timeout", + type=3Dint, + help=3D"Timeout in minutes") =20 return parser.parse_args() =20 @@ -132,6 +137,11 @@ def cache_write(filename, result): def worker(): while True: item =3D items.get() + if args.timeout and args.timeout < time.time(): + findings.append("%s (timeout)" % item["file"]) + items.task_done() + continue + os.chdir(item["directory"]) =20 cache =3D cache_name(item) @@ -164,6 +174,9 @@ if args.cache: args.cache =3D os.path.abspath(args.cache) os.makedirs(args.cache, exist_ok=3DTrue) =20 +if args.timeout: + args.timeout =3D time.time() + args.timeout * 60 + for _ in range(args.thread_num): threading.Thread(target=3Dworker, daemon=3DTrue).start() =20 --=20 2.26.2