From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6519532471426482176 X-Received: by 10.46.125.3 with SMTP id y3mr276456ljc.4.1517951454488; Tue, 06 Feb 2018 13:10:54 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.25.233.148 with SMTP id j20ls10559lfk.12.gmail; Tue, 06 Feb 2018 13:10:53 -0800 (PST) X-Google-Smtp-Source: AH8x226ZASYFj7ENsZDq/Puyo+n8IG3TSdQXdFPftoa7/Dv/u25gqJ9P6ym7QgM88oBvnvFfZ1PX X-Received: by 10.25.31.66 with SMTP id f63mr297270lff.42.1517951453894; Tue, 06 Feb 2018 13:10:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517951453; cv=none; d=google.com; s=arc-20160816; b=CN7fQukEEGSLsjdul2PHRikBciCIsEDmiuqrO3rjeNaGhc7/cjF3cpRQN2fmcYWuOP wdiTpaEByEizeqjv2q2wumo21igf0wizw3RCaWTO6lxKmSHV0YGY7sbgOhmb7lNDXa3X n0dcJML/g0Vc81fij/GFTfqaF3YX4ilsmzKA6IhkpRoHyfbBdF5EeY/GIOX/t1kCNNLy qlkT68a7ZdQHkJXbZbwlZLIcpAYGIscOfnqp2ZTiudpLOsUT4DZl3aWyLmycFHFhJc0f CIlWqGUOlR0V0bAJyH+Szbs+zts3NIuiIVtmn7RjQO8UAYAvYVG02qJivI64/rcIc7yJ chJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :arc-authentication-results; bh=pRt93q5v7m1dIwVrBjNX5c1Dl9ke5kOYnqEFsz4LRRk=; b=VGnbtu6rqM21v1MVI91KzKSDyvSjev7SwPstz4fs3lp3ew8P/ADhH5JEkC1i9nnUTM h2v/gR7/UqUjVT0FkfKkkeu4CMZ0hhZVkyhNf15SetFG0RhE6Z6oo+mzwVG4IK6XzHSc xnxdKUKFrMpunjruXzc49JF/QtwHRjC5gNk3MPLpSM2JhKfm1tp0uKV1fkFBYf7M0H5T EKeqg96toBM/OaCDQwvWH9jNL5Y08KqE1mhtGbybcsPjJTDvQ1rbRIiGEsDh1cpg13gy r8EBEl+vpYFJJ9uDEE7qjnFmIR0+GtGRyjQ568P6NdEjzV93BauqYScQqU8vsVocwETx c4OA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id w29si856296lfc.5.2018.02.06.13.10.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Feb 2018 13:10:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Received: from [10.0.2.15] ([188.227.110.165]) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id w16LAnxR031150 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 6 Feb 2018 22:10:51 +0100 Subject: Re: [PATCH] isar: Clean mount point on bitbake exit To: Jan Kiszka , isar-users@googlegroups.com References: <20180206195516.32153-1-asmirnov@ilbers.de> <1e69c65a-3c5d-abdd-ccb5-103e09371d92@siemens.com> <46bff563-8447-39ec-d59c-97d57e36bc7c@siemens.com> From: Alexander Smirnov Message-ID: Date: Wed, 7 Feb 2018 00:10:44 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <46bff563-8447-39ec-d59c-97d57e36bc7c@siemens.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-TUID: 0LS+jF7tkFrS On 02/06/2018 11:56 PM, Jan Kiszka wrote: > On 2018-02-06 21:45, Alexander Smirnov wrote: >> On 02/06/2018 11:31 PM, Jan Kiszka wrote: >>> On 2018-02-06 20:55, Alexander Smirnov wrote: >>>> 8<-- >>>> >>>> That's it! Branch 'asmirnov/devel', please test and enjoy :-) >>>> >>>> 8<-- >>>> >>>> Now each multiconfig has registered handler for BuildCompleted event >>>> (see >>>> class 'isar-event.bbclass'). Moreover, the '/proc/mounts' file contains >>>> all the active mounts. In addition, from event handler we could derive >>>> all the variables like ${TMPDIR}, ${DISTRO} etc. So it's possible to >>>> find all the active mounts for current multiconfig and clean them. >>>> >>>> NOTE: if build is interrupted by double ^C, some mount points could stay >>>> uncleaned. This is caused by remaining processes started by bitbake, for >>>> example: >>>>   - 'chroot build.sh ...' >>>>   - 'multistrap ...' >>> >>> Can you explain what the race condition is exactly? It seems to work for >>> me so far, no forgotten mounts. >> >> Sometimes after double ^C I see several mounted artifacts in >> buildchroot. But I've also noticed, that there are running processes >> like 'multistrap' and 'build.sh' running *exactly* in this buildchroot. >> >> So, simple test, if you press double ^C and run 'ps ax' after, you will >> likely see running processes. IIRC the same bitbake behavior I saw with >> Yocto, interrupting bitbake doesn't mean to kill the process with >> current task. > > Yes, there is a settling phase, but everything is dead and gone after a > couple of seconds, at least here. My multistrap process stays for a few minutes after, but it happens once per about 10 times. Probably you are lucky and interrupt the build in suitable place. For sure I press double ^C quickly without delay in between. In general I'm not sure if we can handle this, it sounds like bitbake should do this. The correct way to stop the build is to press single ^C, this should work without any issues, but you have to wait until current task is finished. Anyway please let me know if the patch is ok and solves your issue with '/dev/null', so I can apply it. Alex