Subject: Re: [bug#67733] [PATCH v3] daemon: Sacrifice builders on OOM.

From: Ludovic Courtès <[email-masked]>
Date: Sun, 10 Dec 2023 22:51:15 +0100

Hullo!

Tobias Geerinckx-Rice <[email-masked]> skribis:

> * nix/libstore/build.cc (DerivationGoal::runChild):
> Maximise our OOM score adjustment.
>
> Change-Id: I418c763b499ca16e1ffe3c6033319112b9744f51
> ---
>
> v3: In my defens, I'm on a fone.

Nooo, you’re a hero.

> +	/* 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(); }

Sounds like a good idea.  LGTM!

Ludo’.