From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 4NoSFMLadGUzgAEA9RJhRA:P1 (envelope-from ) for ; Sat, 09 Dec 2023 22:23:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 4NoSFMLadGUzgAEA9RJhRA (envelope-from ) for ; Sat, 09 Dec 2023 22:23:14 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tobias.gr header.s=2018 header.b=P3g43kx+; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1702156994; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Y9ANycDGVdXB8Wa5chrJfAWXFPisp4gh0KcOV7gEDHs=; b=klgtbOPBDPn7MWg2v92OrY5H/0pnj3rUrXxjTkORI6V3AJzdDr18CBX3fwnN8T1LKtVbBV U3kGoQ8GdKvK42AHz0qZxoAwOgaIYcj6+Y7fRcbEY0X6MMRGkKGwh4DvCR4B1ORFrI9WG3 Aw21onmjRyh/4WPx7jmYf4GoBdiu35HseXCgda5XSHbloUfhcEJFcecfINOoN5QbgHdOGV mDmmtgXB8kRemodVWWaD8ufNcaP/+FaySavLOxqwwKjG8IN34jjI3Ro5f6NeUXbYewm352 gnK02sR1VEGB9zx5mK8X7CE/+c2f8aautTEzryXu0+KKhnHGjLYMUldzGfH+VA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1702156994; a=rsa-sha256; cv=none; b=E10vvI7/Dojpe0BXKb2w6CxcgQwbfiutNlok3IjemKBmnc5NhfcLBs0NVkpQPB7wfAux+i huC0NhWLnf+YmdX+r+502EeyGUeZb3lc/9DTRS4/o37JRUhAMfMvhGL8sAl2ziWXKz2rRh YVH+YxOL/2CvxZhNWpDnzl+CUr/spRqzVBR9KMWXAaY2c2n+oRAd8YIWVvhUoLhenGPs/J 7F4njV6L6T3QcWICz/c31xwGcfb4D49x25aYyX493vmeAMY2rwIX84UZve1x+FNfnyoOG/ eceZswsvDl7RvG3mm8Lkxd6EBHV4OMDTEEQLeNhI1uI3dA79FuwQAYEfi4Vuig== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tobias.gr header.s=2018 header.b=P3g43kx+; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AF51731DF3 for ; Sat, 9 Dec 2023 22:23:13 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rC4mh-0000sl-MH; Sat, 09 Dec 2023 16:22:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rC4me-0000sV-Sl for guix-patches@gnu.org; Sat, 09 Dec 2023 16:22:49 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rC4me-0002l1-KR for guix-patches@gnu.org; Sat, 09 Dec 2023 16:22:48 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rC4ms-0007DO-41 for guix-patches@gnu.org; Sat, 09 Dec 2023 16:23:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67733] [PATCH] daemon: Sacrifice builders on OOM. Resent-From: Tobias Geerinckx-Rice Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 09 Dec 2023 21:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 67733 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 67733@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.170215696827711 (code B ref -1); Sat, 09 Dec 2023 21:23:01 +0000 Received: (at submit) by debbugs.gnu.org; 9 Dec 2023 21:22:48 +0000 Received: from localhost ([127.0.0.1]:49096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rC4me-0007Ct-53 for submit@debbugs.gnu.org; Sat, 09 Dec 2023 16:22:48 -0500 Received: from lists.gnu.org ([2001:470:142::17]:42978) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rC4mc-0007Cf-1C for submit@debbugs.gnu.org; Sat, 09 Dec 2023 16:22:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rC4mI-0000qr-Mm for guix-patches@gnu.org; Sat, 09 Dec 2023 16:22:26 -0500 Received: from tobias.gr ([80.241.217.52]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rC4mD-0002d6-7i for guix-patches@gnu.org; Sat, 09 Dec 2023 16:22:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=2018; bh=Y9ANycDGVdXB8 Wa5chrJfAWXFPisp4gh0KcOV7gEDHs=; h=date:subject:to:from; d=tobias.gr; b=P3g43kx+L7XOaG9VH0Y9E5Wz7MQ0nxKhobY2lKCqAeVxhP+ihduuNkTfA7MWTk5Lrjr0 jQ3p2wE3m+Fyu2NH8DqdDQDWx4nxZ94D6hdAG1UL2N49FR044YqQcT0Vqt5cDthzBFj3Jt LvRGCYN63xsbTYkRuX88qd96c0zSpjArra6w/GFizPe9lplQ21ESFYHnFctl2Jyn5IeWgk WDbgHIuil+zRTL9m97h9a0uwqDf9X4qeVYBN+I8DnL6454KnrDQRGCx97zvoRVDuvl9boU xU/iE4kQOHf6Q+gCJ6Zqy+CxzTHOfx991hH7/DMpSmxnzMYcKTRUuIekBzrchaNw== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id 70131821 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Sat, 9 Dec 2023 21:22:16 +0000 (UTC) Date: Sun, 3 Dec 2023 01:00:00 +0100 Message-ID: <20231203000032.29995-1-me@tobias.gr> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=80.241.217.52; envelope-from=me@tobias.gr; helo=tobias.gr X-Spam_score_int: 13 X-Spam_score: 1.3 X-Spam_bar: + X-Spam_report: (1.3 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_96_XX=3.405, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Tobias Geerinckx-Rice X-ACL-Warn: , Tobias Geerinckx-Rice via Guix-patches From: Tobias Geerinckx-Rice via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -5.66 X-Spam-Score: -5.66 X-Migadu-Queue-Id: AF51731DF3 X-Migadu-Scanner: mx12.migadu.com X-TUID: ttqO9VlWOFTi * nix/libstore/build.cc (DerivationGoal::runChild): Maximise our OOM score adjustment. Change-Id: I418c763b499ca16e1ffe3c6033319112b9744f51 --- nix/libstore/build.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc index e8259aa4e8..9241418abc 100644 --- a/nix/libstore/build.cc +++ b/nix/libstore/build.cc @@ -2154,6 +2154,12 @@ void DerivationGoal::runChild() determinism. */ int cur = personality(0xffffffff); if (cur != -1) personality(cur | ADDR_NO_RANDOMIZE); + + /* Ask the kernel to eagerly kill us & our children if it runs out of + memory, regardless of blame, to preserve ‘real’ user data & state. */ + try { + writeFile("/proc/self/oom_score_adj", "1000"); // 100% + } catch (...) { ignoreException(); } #endif /* Fill in the environment. */ -- 2.41.0