From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6530156151538974720 X-Received: by 10.25.81.199 with SMTP id g68mr1096270lfl.39.1520423882772; Wed, 07 Mar 2018 03:58:02 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.46.56.1 with SMTP id f1ls167566lja.4.gmail; Wed, 07 Mar 2018 03:58:02 -0800 (PST) X-Google-Smtp-Source: AG47ELvIWkB5qrZ1IiSOIClS/H4X5CivZYfCkbvKJTM0mXKLbGiOy11eIl/qCaHPzCmt3tXs3Ayv X-Received: by 10.46.34.196 with SMTP id i187mr1439865lji.10.1520423882042; Wed, 07 Mar 2018 03:58:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520423881; cv=none; d=google.com; s=arc-20160816; b=otAMCcjpiU0FfpwZQCQk5t+FD+SWAHPMhRmyDei4pgdqjN9TQEdXfN1PVPHeJHnPlx MAPtAo8QUubwOfHJtTCUHiXwMDaw8qjEnZM2DSLuBZTe+Fq82hQ4Zgr+aZ9u7+SIHLvM nUhMPwTh19gihJEnUJYLPUL0J3yd2GD/yuHmVjCmR3HiwASbJgy4yTwM4ty2/O/eb2tu h8SV4BXt5r7zSz5v6MEuY8nvjh51BqL6hE/8pGvgvG09NGkevDVj3Gbs+YizWjfYiGy4 VUUlqEZSsqvHu1uAIRr+LDn9JAklsO3P5SSTf4rnIz5mqbN0xjdVQOLYwIjAvrbs8gEf 8Ydw== 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:cc:to:subject :arc-authentication-results; bh=805JUjxHZuP40Y63F48s+n4cFcXcYw1T4OUlUoG9Or4=; b=aIdl7UnewOpI/Jg4syH8VD1QDHMR5YEN2A7VzYx+3deB7TnajaUPwwslak3Zu1eXT8 Ph4gTYyO8RcGE7SUIa6tBut2HEQNuE6vTwEmzQxzZJXYB6szpIs5xb3/9OjvkDobp+sq Z6tJE3kygemRUzwx1nCZC+xpAgpNJ3x7IGlfG7ahswPlheBowdKQn3I8pJKmc7a19tU/ HdaCyNBcXkNnCdS0IDo14cqEQxI0mqsKxvyCjWMCUiWTQ2U6As4I00qjP6vIILya8Day OCpS4bPHtY60OOOrOnLbAujrHMqjCqVqGm05r+MGdg+GI2Ja7LA3H/XErB8hVZIuwcBI Ampw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id w7si612896lfc.2.2018.03.07.03.58.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Mar 2018 03:58:01 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id w27Bw1Hs001930 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 7 Mar 2018 12:58:01 +0100 Received: from [139.25.68.37] (md1q0hnc.ad001.siemens.net [139.25.68.37] (may be forged)) by mail3.siemens.de (8.15.2/8.15.2) with ESMTP id w27Bw1SB004393; Wed, 7 Mar 2018 12:58:01 +0100 Subject: Re: [PATCH 1/1] isar-events: try unmounting all mounts before returning an error To: "Hombourger, Cedric" Cc: "isar-users@googlegroups.com" References: <20180307110049.43760-1-Cedric_Hombourger@mentor.com> <20180307110049.43760-2-Cedric_Hombourger@mentor.com> <977ddcc3-508c-ca08-d813-5b7b05ea249b@siemens.com> <039a06e5b89b4b9c823448da75438e41@svr-ies-mbx-02.mgc.mentorg.com> From: Jan Kiszka Message-ID: Date: Wed, 7 Mar 2018 12:58:00 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <039a06e5b89b4b9c823448da75438e41@svr-ies-mbx-02.mgc.mentorg.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: vOwhszprh/qH On 2018-03-07 12:34, Hombourger, Cedric wrote: > Hi Jan, > > Ok we can give background jobs plenty of time to run. I believe you may still want my change (and I am glad I decided to put aside the give-up change for now). > In my case, I had no background processes running (Isar had completed everything it needed to do) but would never complete because of the nested mounts done > by a package I was rebuilding. Ah, nested mounts, now I got it :). Then this makes sense, true. Jan > > If we do not implement a give-up mechanism, I would at least suggest logging a warning message every now and then > (e.g. warning: Isar is waiting on background jobs to complete, please be patient...). If the wait becomes really too long, > we could even print the list of children process IDs and names we see. This would give us a clue if we get a problem report > (when I ran bitbake with maximum debugging output, it would not give any hints on what it was doing... this issue was a > nice one to debug; trust me!). > > Cedric > > -----Original Message----- > From: Jan Kiszka [mailto:jan.kiszka@siemens.com] > Sent: Wednesday, March 7, 2018 12:24 PM > To: Hombourger, Cedric ; isar-users@googlegroups.com > Subject: Re: [PATCH 1/1] isar-events: try unmounting all mounts before returning an error > > On 2018-03-07 12:00, Cedric Hombourger wrote: >> Isar would loop forever if a mount cannot be unmounted because another >> bind mount was done underneath it (e.g. /sys/devices on top >> of /sys). Increase of chances of success by trying to unmount >> everything before returning an error. In the /sys/dev case, >> we may try /sys first and fail but would continue to unmount >> /sys/dev. On the following call, only /sys will >> remain and the unmount_all should now succeed. We may want to >> implement a >> timeout: e.g. giveup after 30 tries (i.e. approximately 30 seconds)? >> >> Signed-off-by: Cedric Hombourger >> --- >> meta/classes/isar-events.bbclass | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/meta/classes/isar-events.bbclass >> b/meta/classes/isar-events.bbclass >> index 29c7437..b3ce434 100644 >> --- a/meta/classes/isar-events.bbclass >> +++ b/meta/classes/isar-events.bbclass >> @@ -14,14 +14,15 @@ python isar_handler () { >> # '/proc/mounts' contains all the active mounts, so knowing basepath >> # we can get the list of mounts for the specific multiconfig and >> # clean them. >> + result = True >> with open('/proc/mounts', 'rU') as f: >> for line in f: >> if basepath in line: >> if subprocess.call('sudo umount ' + line.split()[1], >> stdout=devnull, stderr=devnull, >> shell=True) != 0: >> - return False >> - return True >> + result = False >> + return result >> >> devnull = open(os.devnull, 'w') >> >> > > This is by design because it gives us more time when waiting for pending build steps. The problem is that things like multistrap can continue to run in the background, no longer under the control of cooker daemon, and we should wait for them to terminate before > > Jan > > -- > Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux > -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux