Files
8e6033825a Fail healthcheck when temp filesystem free space is low (#8814)
Part of #8811 (production disk-full incident).

During the incident `/healthcheck` stayed green for hours while every
compilation failed with ENOSPC: the empty-job queue check passed (one of
two queue slots still worked), and the EFS health-file read doesn't
touch the root filesystem — so the load balancer never replaced the
instance.

This adds a free-space check on the filesystem where compilation temp
dirs are actually created: `lib/temp.ts` gains `getTempRoot()`, used
both by `temp.mkdir()` and the healthcheck, so the two can't drift
apart. (That resolves via `os.tmpdir()`; `--tmp-dir` flows into it as
`$TMP` via `setupTempDir()` — `/nosym/tmp` in prod.) Below the threshold
the healthcheck returns 500 and the load balancer replaces the instance
*before* hard failure. A `statfs` failure is itself treated as
unhealthy.

Configuration: `healthCheckMinFreeSpaceMiB` — required constructor
argument (no code default, per review); `amazon.properties` sets 2048
(at the incident's ~300MB/min fill rate that gives the LB several
minutes to act); the ceProps fallback is 100 for unconfigured/local
instances; 0 disables the check.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: mattgodbolt-molty <mattgodbolt-molty@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 22:01:53 +01:00
..
2021-10-05 01:45:05 +02:00
2019-08-21 01:26:16 +02:00
2025-01-29 10:41:03 -06:00
2021-09-13 20:22:27 +02:00
2024-10-27 15:28:38 +02:00
2024-10-26 17:42:22 +02:00
2024-03-08 22:25:09 -06:00
2024-03-08 22:25:09 -06:00
2024-03-08 22:25:09 -06:00
2026-02-08 12:50:20 +01:00
2024-03-08 22:25:09 -06:00
2024-03-08 22:25:09 -06:00
2025-07-28 10:34:46 -05:00