[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/06: daemon: Sacrifice builders on OOM.
From: |
guix-commits |
Subject: |
05/06: daemon: Sacrifice builders on OOM. |
Date: |
Fri, 15 Dec 2023 18:03:50 -0500 (EST) |
nckx pushed a commit to branch master
in repository guix.
commit d993ed43b2bae8717437aa27d9d33fd223a6411f
Author: Tobias Geerinckx-Rice <me@tobias.gr>
AuthorDate: Sun Nov 19 01:00:00 2023 +0100
daemon: Sacrifice builders on OOM.
* 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..54555b92d7 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. */
- branch master updated (92f179ab20 -> fa0563e7fa), guix-commits, 2023/12/15
- 01/06: gnu: iperf: Update to 3.16., guix-commits, 2023/12/15
- 04/06: gnu: inxi-minimal: Update to 3.3.31-2., guix-commits, 2023/12/15
- 05/06: daemon: Sacrifice builders on OOM.,
guix-commits <=
- 06/06: bash completion: Complete ‘guix style -f’ with files., guix-commits, 2023/12/15
- 02/06: gnu: libmediainfo: Update to 23.11., guix-commits, 2023/12/15
- 03/06: gnu: mediainfo: Update to 23.11., guix-commits, 2023/12/15