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 8C2E7C54E5D for ; Fri, 15 Mar 2024 01:43:37 +0000 (UTC) Received: from mx0b-0064b401.pphosted.com (mx0b-0064b401.pphosted.com [205.220.178.238]) by mx.groups.io with SMTP id smtpd.web11.10353.1710467008611408341 for ; Thu, 14 Mar 2024 18:43:28 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@windriver.com header.s=PPS06212021 header.b=MBK9cHnf; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.178.238, mailfrom: prvs=3804134e78=changqing.li@windriver.com) Received: from pps.filterd (m0250811.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 42F1e3ON009666 for ; Fri, 15 Mar 2024 01:43:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=content-type:message-id:date:subject:to:cc:references:from :in-reply-to:mime-version; s=PPS06212021; bh=SLujGYSKaAvbSJpnhqI JBKgOwKUnBir/vdRh7oP7dys=; b=MBK9cHnfkS41SGV2oF6p3yLjxyVYTo+zYxw SXSb3MeTrGKweXFURlXK5/ug+SSMM6qNiXbaxqVsggYV8En2anGrNjeZk+2ErhJH USG6vtR4ckhurw0nmYjcf3ZQHIhqiARc5kx3+fKZQ88h1Y+nrRadXN9TQX7MiDM7 RxKcyxRsFij6JOw0vDHsYUaAcErDZdfC7utD9oJRdwyPD7w06BG7DdFB0xXjv7ii IGUX+60eAm42gilb0hlmZpWbZEKR/tYIkJoqwXUr1bSN6GQwm9A8IX9qvNrB2AY3 eJ3Cdu8xvfDyioYgi4+Tsu4EF0Z7gqepZi7liH1uEf7l64j2RDA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3wv9x9846k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 15 Mar 2024 01:43:27 +0000 (GMT) Received: from m0250811.ppops.net (m0250811.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.24/8.17.1.24) with ESMTP id 42F1hRM2013345; Fri, 15 Mar 2024 01:43:27 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2169.outbound.protection.outlook.com [104.47.59.169]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3wv9x9846j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Mar 2024 01:43:27 +0000 (GMT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HfxEHk0f0qictD2vSJhJY1qgA7Q66qA0mU9JQMdMqoDUtWYy7QEYW3XiXZBPkgcwCxsuE3OulzeWyh3bv9WXg/w6q+DHE53DCbDSQ1aitTR2zH4TSNboI7pLP+YsCFf0Lg3AtB0u09A3SsKUBrPwz5Ar0hkYIuWOuUje/PRjt4b1WutQoaH3uCiRvc/DrDJm8dRkDC17SSVUgP8N/BZOUfeTgBZW8D8LSnZQrJOVi13VZcm8cjnMu+AeP+xEPwA7GajBsD4AoR1JG7+GHfn5GH7/TisO+1nVFqEpf1Q8I649JvxaPBA1Srby69DQyNZaoCKsqFiQ7STDyZxdFXv6lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SLujGYSKaAvbSJpnhqIJBKgOwKUnBir/vdRh7oP7dys=; b=ibLopJc3tfv2JuTMClrHI1LkwvgTeRJpxx6M4wfP5wIJEFOxLDtReoutskYfdFnKadKK7Di2X9RxZthlz7U6hT5XyKi1JTvXO0+CpizzZyxWJm/eETfJ4kjTjnVlwXq9LguXdZDK+yFat2xe9LXjVuu2sSZ+/kF1i16K38PEjfu2BTBVC6oi2yAxZVPRYd9L+goVoStxfkDpltTKnbXws34NuJzoQoKYQEk9o6AJNJsKDLniVeOK+/PzC3ehJ9iBunGOXAtrWWgYjFCTCjfcXeXQyCZ7SVh2Y3Q8zsexjiTNQKfNiDGi626/BErcb28I7CHJBSOd3GnO4PiKwV0pAQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from DS0PR11MB7312.namprd11.prod.outlook.com (2603:10b6:8:11f::18) by SA2PR11MB4889.namprd11.prod.outlook.com (2603:10b6:806:110::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.19; Fri, 15 Mar 2024 01:43:24 +0000 Received: from DS0PR11MB7312.namprd11.prod.outlook.com ([fe80::d168:2e49:fb61:dc21]) by DS0PR11MB7312.namprd11.prod.outlook.com ([fe80::d168:2e49:fb61:dc21%7]) with mapi id 15.20.7386.017; Fri, 15 Mar 2024 01:43:23 +0000 Content-Type: multipart/alternative; boundary="------------Dl0NBMdqiKb74l0vqvSixgI2" Message-ID: <74240c6b-83cd-45fc-8b12-a3c14d5347fd@windriver.com> Date: Fri, 15 Mar 2024 09:43:17 +0800 User-Agent: Mozilla Thunderbird Subject: Re: [OE-core] [PATCH V2] dnf: remove log_lock.pid before exit Content-Language: en-US To: Alexander Kanavin , Qi.Chen@windriver.com Cc: Richard Purdie , "openembedded-core@lists.openembedded.org" References: <20240307091925.2324637-1-changqing.li@windriver.com> From: Changqing Li In-Reply-To: X-ClientProxiedBy: TYAPR03CA0019.apcprd03.prod.outlook.com (2603:1096:404:14::31) To DS0PR11MB7312.namprd11.prod.outlook.com (2603:10b6:8:11f::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7312:EE_|SA2PR11MB4889:EE_ X-MS-Office365-Filtering-Correlation-Id: 372a8451-aaf8-4ae3-b36f-08dc44914cf4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zC9rTceiNsXT9rozsAuRrErpPNMRBF0GE1op/XrtjN7Y4ezkgJMe4wd6DaOTDIdaeW+vTOHWMwIUzhpHGMbczCpONDTBc3Ee0XP4ThaLzBA0zp9BKONmWa31kMfExBmfkZTCPtc+fliReJO2oNPqUjrt5w7DmGEoQU05ZW/y0oalWHEmDEVMsWWNdK4BHEIv8lcPv1v+ZEUHbQ+LTWTzvpePY7rRHzTVTKLKvQmHoX/KxMn8FFABs9lqwso76CZ++c/ylufWers5z6csgdouIUXRTk5jHLyCbSpM7nNoX26HDxnbvutDOT55VZL9sPigdgmMqCchBC9FUlrKz2QRqPpcAIuRKbX63W5bvZy/ZQNvZNq4BB82m0OBT+FRpSgtOTQysmKmiU2IdFu2ef322eAImuVn31XGe8qPbnU3AjZrgon8wofqiADssjBuBuGXyy0eOYSVT8GYdxqA7oS2KYIuZj00NxMrCrlD1K7yC1+/97jrH2nDHIhuFGGRr61PemzsPHqdvRHcEXxWjkXHshQbiWFLNCZDTmpOUjDbcvCVarKty1fyVwsufksWRcnD19OfCtQZvQpVm34rwaE/LwrymEvYw6UxbigBWOhIgbc3pwgMMHeUTpsp84GU71W+ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB7312.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(366007)(1800799015);DIR:OUT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rM2ZyZnpXdVhMNWRoYXRnaHE0MjJOTm1UbHlK?= =?utf-8?B?N0dCaU85VWZhazR5Z2gyM3NvZXF0T1JDZnpEZURzNjFBR3VIYW5hMjRLTkUy?= =?utf-8?B?ZXl5N1VpTzRWQUtHcnhWVXZLZXhiVGJuSkZVYlFSdE0xN0pNekZFdTRoU1Fl?= =?utf-8?B?OUxlMitGYkovQVIzNEErS2cvRXlabmlCNWN2dXJOVFIwMkpLTWdjY2RlU1hK?= =?utf-8?B?TzBtVWNGNWdUMUU4WVM2UlNOdlFiNHg1ZnVyS0V1ZVg2MmVQN1YxU3cveVVn?= =?utf-8?B?OExpOXJtcFhvOVNnbGFWUWpWcnk5UnVnaUE4WmhpcEFZU0JUZHhkOXBXRGtB?= =?utf-8?B?MUZ3dHdvSkV0WnE2WkFod0FNdzVXem1Tdi9PbVpVbThvdExwTUE3eWNOVjR4?= =?utf-8?B?bFA4aEcyNmxxRjlrVGNoUzVmckl6aVJZYldLeER2Q2pYVC9URVROWmR0T2xY?= =?utf-8?B?Vmc9PQ==?= X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 372a8451-aaf8-4ae3-b36f-08dc44914cf4 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7312.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2024 01:43:23.3618 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: E/CWAEwFbCsM+jKCjuoAQWYfa0BbC9cTYLSH0pTsI3YGmblvbmSY0IXgAAA+pI9Jp+lC9NyA15/czazCsliWZiaS/+jcYI8R+AeHxsCcms0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB4889 X-Proofpoint-GUID: R_AjTMSNPwmHHhnj5sTryIfYXKXBTcf4 X-Proofpoint-ORIG-GUID: YNPQr_D4D7yo0lHnaSPnIA9_FO-E3E3y X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-14_13,2024-03-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 malwarescore=0 priorityscore=1501 bulkscore=0 impostorscore=0 adultscore=0 suspectscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2403140001 definitions=main-2403150010 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, 15 Mar 2024 01:43:37 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/197122 --------------Dl0NBMdqiKb74l0vqvSixgI2 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-0064b401.pphosted.com id 42F1e3ON009666 On 3/7/24 19:42, Alexander Kanavin wrote: > CAUTION: This email comes from a non Wind River email account! > Do not click links or open attachments unless you recognize the sender = and know the content is safe. > > On Thu, 7 Mar 2024 at 11:21, Chen Qi via lists.openembedded.org > wrote: >> You can see dnf's solution is:https://github.com/rpm-software-manageme= nt/dnf/blob/master/etc/tmpfiles.d/dnf.conf >> >> I don't think dnf community will look into this issue. And I would exp= ect it to be a complicated one. Because dnf's own solution looks like mor= e of a workaround. At the same time, yocto based systems will sometimes h= ave log_lock.pid left in target filesystems. Users typing 'ls /' will not= ice it. >> >> We have an OE specific patch:https://git.openembedded.org/openembedded= -core/commit/?id=3D742a1b71249f4da1c8d8e13e270b0eb6128a3f66 >> I can see that this OE specific patch, 0001-dnf-write-the-log-lock-to-= root.patch, does solve some issue. Unfortunately, at the same time, it in= troduces this specific issue, a easy-to-notice one. >> >> My suggestion is that we merge this fix into 0001-dnf-write-the-log-lo= ck-to-root.patch, because they really belong together. I guess we can't e= xpect dnf community to devote time into this, as they've already got a so= lution. And I'm not sure if anyone in OE community is familiar with dnf e= nough to solve this issue. So let's make things a little better, avoiding= users of Yocto systems see this log_lock.pid file when they type 'ls /'. >> >> If you have any other suggestion, please let us know. > We need to find out why it happens, and why it happens only sometimes. > If lock file does not get properly deleted that is quite possibly > masking a different issue which needs fixing, and the proposed patch > just sweeps it all under the carpet in the name of giving users an > aesthetically pleasing rootfs. So the answer is still no. > > If you are having difficulty debugging the situation where the lock > file does get left behind, can you provide a way for me to reproduce > the issue? I just build core-image-minimal, and I'm not seeing it: > > alex@Zen2:/srv/storage/alex/yocto/build-64-alt$ ls > tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/rootfs/ > bin boot dev etc home lib media mnt proc root run sbin srv > sys tmp usr var This issue only happened when dnf log rotate is happened. maybe install "a lot" packages can trigger reproduce this issue more quickly. > > If you can't provide that, then you can certainly still do more on > your side: build core-image-minimal with plain poky, ensure the lock > file gets deleted, then build your own private things where the file > does not get deleted, then investigate why the code path that deletes > the lock file isn't being taken in the latter case. You can see the > code where the lock log (self.rotate_lock) is used in logging.py: > > def emit(self, record): > while True: > try: > if self.shouldRollover(record): > with self.rotate_lock: > # Do rollover while preserving the mode of the > new log file > mode =3D os.stat(self.baseFilename).st_mode > self.doRollover() > os.chmod(self.baseFilename, mode) > logging.FileHandler.emit(self, record) > return > except (dnf.exceptions.ProcessLockError, > dnf.exceptions.ThreadLockError): > time.sleep(0.01) > except Exception: > self.handleError(record) > return > > And the deletion happens in lock.py: > > def __exit__(self, *exc_args): > if self.count =3D=3D 1: > os.unlink(self.target) > self._unlock_thread() Hi, Thanks for trying to help.=C2=A0 I had try to find the root cause when I=20 opened the upstream issue, but unfortunately, not got the root cause,=C2=A0= I=20 thought it should be a complicated one. After do more investigating recently,=20 the root cause should be found, and I have send pull request [1] to=20 upsteam dnf , will backport the patch if upstream accept the fix. [1] https://github.com/rpm-software-management/dnf/pull/2065 //Changqing > > > > Alex > > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- > Links: You receive all messages sent to this group. > View/Reply Online (#196785):https://lists.openembedded.org/g/openembedd= ed-core/message/196785 > Mute This Topic:https://lists.openembedded.org/mt/104784184/3616873 > Group Owner:openembedded-core+owner@lists.openembedded.org > Unsubscribe:https://lists.openembedded.org/g/openembedded-core/unsub [= changqing.li@eng.windriver.com] > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- > --------------Dl0NBMdqiKb74l0vqvSixgI2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 3/7/24 19:42, Alexander Kanavin wrote:
CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

On Thu, 7 Mar 2024 at 11:21, Chen Qi via lists.openembedded.org
<Qi.Chen=windriver.com@lists.openembedded.org> wrote:
You can see dnf's solution is: https://github.com/rpm-software-management/dnf/blob/master/etc/tmpfiles.d/dnf.conf

I don't think dnf community will look into this issue. And I would expect it to be a complicated one. Because dnf's own solution looks like more of a workaround. At the same time, yocto based systems will sometimes have log_lock.pid left in target filesystems. Users typing 'ls /' will notice it.

We have an OE specific patch: https://git.openembedded.org/openembedded-core/commit/?id=742a1b71249f4da1c8d8e13e270b0eb6128a3f66
I can see that this OE specific patch, 0001-dnf-write-the-log-lock-to-root.patch, does solve some issue. Unfortunately, at the same time, it introduces this specific issue, a easy-to-notice one.

My suggestion is that we merge this fix into 0001-dnf-write-the-log-lock-to-root.patch, because they really belong together. I guess we can't expect dnf community to devote time into this, as they've already got a solution. And I'm not sure if anyone in OE community is familiar with dnf enough to solve this issue. So let's make things a little better, avoiding users of Yocto systems see this log_lock.pid file when they type 'ls /'.

If you have any other suggestion, please let us know.
We need to find out why it happens, and why it happens only sometimes.
If lock file does not get properly deleted that is quite possibly
masking a different issue which needs fixing, and the proposed patch
just sweeps it all under the carpet in the name of giving users an
aesthetically pleasing rootfs. So the answer is still no.

If you are having difficulty debugging the situation where the lock
file does get left behind, can you provide a way for me to reproduce
the issue? I just build core-image-minimal, and I'm not seeing it:

alex@Zen2:/srv/storage/alex/yocto/build-64-alt$ ls
tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/rootfs/
bin  boot  dev  etc  home  lib  media  mnt  proc  root  run  sbin  srv
 sys  tmp  usr  var

This issue only happened when dnf log rotate is happened. maybe install 

"a lot" packages can trigger reproduce this issue more quickly. 


If you can't provide that, then you can certainly still do more on
your side: build core-image-minimal with plain poky, ensure the lock
file gets deleted, then build your own private things where the file
does not get deleted, then investigate why the code path that deletes
the lock file isn't being taken in the latter case. You can see the
code where the lock log (self.rotate_lock) is used in logging.py:

    def emit(self, record):
        while True:
            try:
                if self.shouldRollover(record):
                    with self.rotate_lock:
                        # Do rollover while preserving the mode of the
new log file
                        mode = os.stat(self.baseFilename).st_mode
                        self.doRollover()
                        os.chmod(self.baseFilename, mode)
                logging.FileHandler.emit(self, record)
                return
            except (dnf.exceptions.ProcessLockError,
dnf.exceptions.ThreadLockError):
                time.sleep(0.01)
            except Exception:
                self.handleError(record)
                return

And the deletion happens in lock.py:

    def __exit__(self, *exc_args):
        if self.count == 1:
            os.unlink(self.target)
        self._unlock_thread()

Hi,

Thanks for trying to help.  I had try to find the root cause when I opened the upstream issue, but unfortunately, not got the root cause,  I thought 

it should be a complicated one. After do more investigating recently, the root cause should be found, and I have send pull request [1] to upsteam dnf ,

will backport the patch if upstream accept the fix.

[1] https://github.com/rpm-software-management/dnf/pull/2065

//Changqing




Alex

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#196785): https://lists.openembedded.org/g/openembedded-core/message/196785
Mute This Topic: https://lists.openembedded.org/mt/104784184/3616873
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [changqing.li@eng.windriver.com]
-=-=-=-=-=-=-=-=-=-=-=-

--------------Dl0NBMdqiKb74l0vqvSixgI2--