From patchwork Thu Oct 24 10:09:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Mikanovich X-Patchwork-Id: 3883 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Thu, 24 Oct 2024 12:10:13 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-lf1-f59.google.com (mail-lf1-f59.google.com [209.85.167.59]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 49OAA4Na017693 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 24 Oct 2024 12:10:04 +0200 Received: by mail-lf1-f59.google.com with SMTP id 2adb3069b0e04-539f7d8bffbsf1026303e87.0 for ; Thu, 24 Oct 2024 03:10:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1729764598; cv=pass; d=google.com; s=arc-20240605; b=Rv9JBovdgBfayoI2UsPKv+poIL91weKY3wqQIunnj2wbO+cAkYZLB5CPfd1IgJsTBh VZcmhJYcoXSKwrhBsoQv9/KxfwdUssjyhMMcr0/V+lBhW7DgMDJAhNv0bEf/InSXUtFl hqeX6aeFkbfA3jOSOPQjcpoi2+UqV3uecipu7mRb+Ne8Wr3M414L53GDXU5rj3NYIwQD Z53qtUgiHseklQ0sM3Jsvcp/AZlvNxpWzjFaZ5ouS0kcSp7T3q1zhtbs0YSvIt4oqCdr 4uO7bmEXujEYhqwGYiQCLrMAAoU6pcCDRAzb50Aqal9iJp0PbsuG63SwNG0mDME/boO7 QZkQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=tV+Pp6SyA2642s8MukJxg5jzAZoUSupM8Nw0mV04fIY=; fh=U0MUrV/PiE/EzwgNcWE5322xpiiRetjoAgEd8A5FSVM=; b=G/gufiMuQapiQjOYTz/z61g0EJOt1e+jihzMHUxe680BhytqOtGD6AQVWWSnGFAXNb DKIBWVPQfc0UPgprq2GUDZe4RqZ+x2K/6YAehvZ1EMHvFSzbjqWh35aTnDuoYlrpRoN3 0t76szyPN2Y94qNf+7LQURVNWGBK5T4Qhzu9aDD8lj+cWlmdqZQPG3FejTRmVflk27Df 0fmhx+pcCbd4o2z+IcRHMNOw8NOsdY7pERQ19CLa/E4JcnECJALTnVzXrb2bd0Z+C6Ul Agyx+oZJCMeav1pmH+TxDY6IYNUuz+l37FHJnMVBVcBGweZwoYdLBF7zVrYfAVaqVnTO 7q7A==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1729764598; x=1730369398; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :sender:from:to:cc:subject:date:message-id:reply-to; bh=tV+Pp6SyA2642s8MukJxg5jzAZoUSupM8Nw0mV04fIY=; b=sKD644bJbXeH0a+wpmPNV3g93ooRd7qJ0PtwtAlPYzZ9gJS/QWME2dYoTrsZsYlYId dSv6LIjHXwxwh1R3ES1f14AwjimS68Q0uf1TtTMLHfqMXIdS9yNlNi9eW5d6KG2ELP+S sgFSTmQK+AVtsgQub7QI8dyZ8wLZXsBWj88cka6n6DYUw8684spbf9cBzwAOd6eNDJjJ CkXHWZnOU5EfU9mRDrGre8Af2kfhsADkxrS5dMefpXxE9+OFoIqunRaIBMnVSndpEJrY vXgH9nucJJBWH+1y3b4GcrcJkdl4+TnV1mxHgU9rh/kNavsZcOuZRXTDo4zE7/Nuc0s5 Vhhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729764598; x=1730369398; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-beenthere:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=tV+Pp6SyA2642s8MukJxg5jzAZoUSupM8Nw0mV04fIY=; b=lib/l8SfoZ4HYhHBKibHwe+LlgYuicC9waO92B9HFXS+BeCknv398nkhriKH41ZByH HWYU0EX6m+I7/ZumDyuWCTm9EmhnntrGxt0sh4w14pn9hLMs1JYROddTV4KbiWxql8Oe O5HH5WF6mhM5gA+PE+jSoCe9VFaSh77qQ7RHCy88EJbTKP27LzpPPiaJBozC5Cmq/YUJ IAODBAjkdaQYvPCk6fU7a3OQ8t50PkIJd72CSBp5GARJCqg5VDeNvA3jn+MwgjSU/EBz uyfs86u5p1V2Kaa134QAdBqUsxIsdZupzgNhFGUy5rvgTCZKLhEiI2ORrHjqEPJbHyC4 xoDw== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCUXv9M9Hs5tWnqa8nJr0lSH/zTwBKvKO0VMlbkvAOqGfpPuZqhILXzt6+ObhZ656Jpctk+F3Ew=@isar-build.org X-Gm-Message-State: AOJu0YyLPOqy7pTlcUTr/eAoxSNWp4w3ZU1GgYjzBl7N0AThclpPIwbN l6aVzCin9FERqgSgmEheouDUBgufd/Wq7F2BR2deIe+MKYJA9q00 X-Google-Smtp-Source: AGHT+IE0acAoNRLe4hTCWhpCNgh/bZ1jeYyP0kSR6d0/5eYSKoDY06zT1PNgRQevLAFSOjo1YX8kJw== X-Received: by 2002:a05:6512:3051:b0:53a:38:7b70 with SMTP id 2adb3069b0e04-53b236da75amr524273e87.8.1729764597123; Thu, 24 Oct 2024 03:09:57 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:2283:0:b0:2fb:3a87:c904 with SMTP id 38308e7fff4ca-2fca577458dls1461831fa.0.-pod-prod-00-eu; Thu, 24 Oct 2024 03:09:55 -0700 (PDT) X-Received: by 2002:a05:6512:687:b0:539:f6e1:f28 with SMTP id 2adb3069b0e04-53b2375d2c9mr552414e87.30.1729764594962; Thu, 24 Oct 2024 03:09:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729764594; cv=none; d=google.com; s=arc-20240605; b=KZFLJyWVepsRHyGYYdTI1OclqccoJPzri+oyw5/1oIcSLfhalOkAY5FGWms3tTF+2/ 9vcAQHX1+6q+P1ZlepjBV23PRr+5VmLLuLE6NmiewBCp8JWjVNvu0AL3aQa/H15TuVpj 9zZauT9XidkgOcJbT34IwfDmEE6nx1hMDjL/YB4n0VgDKWkSat+bF5XkOPz9o7IilMnE BARnUEHUm7P6XilkI3GYRzyla8O3VVmGDB3Z/oJFh6AIj6+YX4y0wKS4BJE/xyy/bUtE RCZD4zBPeJLSjC+xQSTorBLOWyEFDAuLctYUAUDsjzlU0bP8c6N/zwoCzrHCWnSy5Kdx tVBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=KzJWmR7J8Cv2+2VLG1BAe1WKtJ520xRwBcaVTo0HqeA=; fh=/h9QQkzJ8EboVkWg45aWwpaUro6WMavIVd2OhN45RtE=; b=fdKMTS68V8swIP0MWjm6Z2tmmi7DZY845/40BdgTAhwb0+roEXB89VU1fzQuELXcB0 tlh1CA578jisuS2aNRnIj/ilhk+ShD6yrkFmEyEcS1feh6/QE4TjMrqB20oCZVzei6oO leT69xVFi14pJU2H3L5/0LMWiqg+zg++YpiYJB6/Md08z18hD3IkBkiZzwRnJ0lDDqXJ PmUPiOUdB/QHca730fpD2VTj7IxF2+mm2gbCUVV9ggQ3AqjJwpPXLd5ji/X3guPUK9Q5 bw9bNf+12EnWuBrZfTERkPZCBL6YZ8ne9J5y9V/jBuDU2iZps2AD9qr7EdaRmnsLupFS E7lA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id 2adb3069b0e04-53a223edd8dsi223149e87.10.2024.10.24.03.09.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2024 03:09:54 -0700 (PDT) Received-SPF: pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Received: from user-B660.promwad.corp ([159.148.83.114]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 49OA9rND017677 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Oct 2024 12:09:53 +0200 From: Anton Mikanovich To: isar-users@googlegroups.com Cc: Anton Mikanovich Subject: [PATCH v2] deb-dl-dir: Avoid hanging mounts on failed download Date: Thu, 24 Oct 2024 13:09:46 +0300 Message-Id: <20241024100946.214428-1-amikan@ilbers.de> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-4.6 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_RP_CERTIFIED,RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-Original-Sender: amikan@ilbers.de X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= If apt-get fails during debsrc_download execution, one mount will be left behind. If ISAR_FAIL_ON_CLEANUP is set to 1, an additional error will be observed: | Err:1 http://ftp.de.debian.org/debian bookworm/main rtmpdump 2.4+20151223.gitfa8646d.1-2 (dsc) | Could not connect to ftp.de.debian.org:80 (141.76.2.4), connection timed out | Err:2 http://ftp.de.debian.org/debian bookworm/main rtmpdump 2.4+20151223.gitfa8646d.1-2 (tar) | Unable to connect to ftp.de.debian.org:80: | Err:3 http://ftp.de.debian.org/debian bookworm/main rtmpdump 2.4+20151223.gitfa8646d.1-2 (diff) | Unable to connect to ftp.de.debian.org:80: | E: Failed to fetch http://ftp.de.debian.org/debian/pool/main/r/rtmpdump/rtmpdump_2.4%2b20151223.gitfa8646d.1-2.dsc Could not connect to ftp.de.debian.org:80 (141.76.2.4), connection timed out | E: Failed to fetch http://ftp.de.debian.org/debian/pool/main/r/rtmpdump/rtmpdump_2.4%2b20151223.gitfa8646d.1.orig.tar.gz Unable to connect to ftp.de.debian.org:80: | E: Failed to fetch http://ftp.de.debian.org/debian/pool/main/r/rtmpdump/rtmpdump_2.4%2b20151223.gitfa8646d.1-2.debian.tar.xz Unable to connect to ftp.de.debian.org:80: | E: Failed to fetch some archives. | WARNING: exit code 100 from a shell command. | DEBUG: Executing shell function rootfs_do_umounts | DEBUG: Shell function rootfs_do_umounts finished | DEBUG: Python function do_rootfs_postprocess finished NOTE: recipe isar-image-ci-1.0-r0: task do_rootfs_postprocess: Failed NOTE: Tasks Summary: Attempted 699 tasks of which 391 didn't need to be rerun and 1 failed. ERROR: build/tmp/work/debian-bookworm-armhf/isar-image-ci-qemuarm/1.0-r0/rootfs/deb-src left mounted Protect mounting with a trap for cleanup in case of failure. Signed-off-by: Anton Mikanovich --- meta/classes/deb-dl-dir.bbclass | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta/classes/deb-dl-dir.bbclass b/meta/classes/deb-dl-dir.bbclass index 55e56c50..7ebd057e 100644 --- a/meta/classes/deb-dl-dir.bbclass +++ b/meta/classes/deb-dl-dir.bbclass @@ -48,6 +48,9 @@ debsrc_download() { debsrc_do_mounts "${rootfs}" + trap 'exit 1' INT HUP QUIT TERM ALRM USR1 + trap 'debsrc_undo_mounts "${rootfs}"' EXIT + ( flock 9 set -e printenv | grep -q BB_VERBOSE_LOGS && set -x