From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBC88C4167B for ; Fri, 10 Nov 2023 18:02:07 +0000 (UTC) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by mx.groups.io with SMTP id smtpd.web11.34613.1699639318528975485 for ; Fri, 10 Nov 2023 10:01:58 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=dXNlIjl9; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.47, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-407da05f05aso16188505e9.3 for ; Fri, 10 Nov 2023 10:01:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1699639317; x=1700244117; darn=lists.yoctoproject.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=3wVegIi44d/5dP6iKqEdBqPoE7L1HNSscGHEnfH2cyc=; b=dXNlIjl9AzUKfjYvknELsNbc0oNYkPQnquDZsVMbvIOH40RhR50dzX1M3XWg9N1yqd 9uGbJuoe5MVBfOvqikp6T7uRgFE2bAfnCRDb1jLCbeWzj7dbnz6bZEtSoW5EX0gipVF3 KPCck9ndVr/kRDhuZQLfv688XUoxEI8F4CS1I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699639317; x=1700244117; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=3wVegIi44d/5dP6iKqEdBqPoE7L1HNSscGHEnfH2cyc=; b=E8BrYqXgfyVcRjN5za7psfuqLNu4SQNh2hOlg65t5KYEes6E99EyZab3IGwKRgM5BK KdXeuyf6eaLPekl9rWdqkfJy82mgNp7C/c8bN/SA7dUKdu1zmCLyCHmxFFSZDG/xlQSF 9B0Q8Yhkdl52cza26PhhoZcm3DOldsqlwVDAJVkqMx2fWujGMB7cMe6+TcZdKwPAznm1 bAFs0CcqNQ/YLmVLxfOgiCn62mbGI8VYuUE4M59VIzBhArD/2QUjwgEgw6XeM1BF2t4Q rH0O2dmbGKeahRCrkLfgwprRQGEnHDTIxczuxmj2/LP/NOEZJgPam5WEDA9g42JBlCo9 4Tcw== X-Gm-Message-State: AOJu0Yx9SA33RSsIZtVYyJ35pxDTu0VaMV7tNguxUklJDG39vufnneQb HCCNRT/YMKHwuJgsZf8zXo1ccA== X-Google-Smtp-Source: AGHT+IHaV93fqG3yUgM4gWuSoUNfTrUpQfF+hTKzO3TVhbADa5Kbr8+WdYnTtlolEDm+BKVzeamfIQ== X-Received: by 2002:a05:600c:4d01:b0:406:8c7a:9520 with SMTP id u1-20020a05600c4d0100b004068c7a9520mr71585wmp.36.1699639316901; Fri, 10 Nov 2023 10:01:56 -0800 (PST) Received: from ?IPv6:2001:8b0:aba:5f3c:3703:3761:dd76:7c61? ([2001:8b0:aba:5f3c:3703:3761:dd76:7c61]) by smtp.gmail.com with ESMTPSA id h3-20020adfa4c3000000b0031980294e9fsm2373928wrb.116.2023.11.10.10.01.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Nov 2023 10:01:56 -0800 (PST) Message-ID: <85003f99a53c415511aa2c3efa54a32ee1303e13.camel@linuxfoundation.org> Subject: Re: [Toaster] [PATCH] toaster: log ProcessLookupError in test_runbuilds From: Richard Purdie To: Tim Orling , bitbake-devel@lists.openembedded.org, toaster@lists.yoctoproject.org Cc: Tim Orling Date: Fri, 10 Nov 2023 18:01:55 +0000 In-Reply-To: <20231110153009.3592572-1-tim.orling@konsulko.com> References: <20231110153009.3592572-1-tim.orling@konsulko.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.1-0ubuntu1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 10 Nov 2023 18:02:07 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/5994 On Fri, 2023-11-10 at 07:30 -0800, Tim Orling wrote: > This repeatably fails: >=20 > Exception in thread Thread-2: > Traceback (most recent call last): > File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner > self.run() > File ".../poky/bitbake/lib/toaster/tests/commands/test_runbuilds.py", l= ine 39, in run > os.kill(int(pid), signal.SIGTERM) > ProcessLookupError: [Errno 3] No such process >=20 > Rather than have a hard error, add logging and output as a warning. >=20 > Signed-off-by: Tim Orling > --- > lib/toaster/tests/commands/test_runbuilds.py | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) >=20 > diff --git a/lib/toaster/tests/commands/test_runbuilds.py b/lib/toaster/t= ests/commands/test_runbuilds.py > index c77d6cf4..14b35764 100644 > --- a/lib/toaster/tests/commands/test_runbuilds.py > +++ b/lib/toaster/tests/commands/test_runbuilds.py > @@ -19,6 +19,10 @@ import time > import subprocess > import signal > =20 > +import logging > + > +logger =3D logging.getLogger("toaster") > + > =20 > class KillRunbuilds(threading.Thread): > """ Kill the runbuilds process after an amount of time """ > @@ -36,8 +40,11 @@ class KillRunbuilds(threading.Thread): > =20 > with open(pidfile_path) as pidfile: > pid =3D pidfile.read() > - os.kill(int(pid), signal.SIGTERM) > - > + try: > + os.kill(int(pid), signal.SIGTERM) > + except ProcessLookupError as err: > + logger.warning("Failed to kill pid. %s" % err) > + pass > =20 Is this a case of "just ensure bitbake has really exited"? If so we perhaps don't need the warning as it is quite likely it has exited? Cheers, Richard