@bli-cockpit/cli 0.2.285 → 0.2.286

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,7 +21,7 @@ export async function runCockpitCli(argv, io) {
21
21
  }
22
22
 
23
23
  if (command === "--version" || command === "-V" || command === "version") {
24
- writeLine(io?.stdout ?? process.stdout, "0.2.285");
24
+ writeLine(io?.stdout ?? process.stdout, "0.2.286");
25
25
  return 0;
26
26
  }
27
27
 
@@ -15,7 +15,7 @@
15
15
  *
16
16
  * Three reasons close the gate, most urgent first:
17
17
  *
18
- * - `low_disk`: the volume's free space is under max(5 GiB, 5% of the volume),
18
+ * - `low_disk`: the volume's free space is under max(5 GiB, min(5% of the volume, 20 GiB)),
19
19
  * for a file bigger than 1% of the free space left (smaller files are admitted).
20
20
  * - `state_over_ceiling`: everything the collector writes under its state dir
21
21
  * (staging, spool, logs, cursors, state; never the study folders
@@ -40,10 +40,17 @@ import { classifyStateEntry } from "./state-dir-audit.js";
40
40
  /** Hard ceiling on everything the collector writes under its state dir. */
41
41
  export const DEFAULT_STATE_CEILING_BYTES = 512 * 1024 * 1024;
42
42
  export const STATE_CEILING_ENV = "COCKPIT_STATE_CEILING_BYTES";
43
- /** Overrides the low-disk floor (bytes); unset means max(5 GiB, 5% of volume). */
43
+ /** Overrides the low-disk floor (bytes); unset means max(5 GiB, min(5% of volume, 20 GiB)). */
44
44
  export const MIN_FREE_ENV = "COCKPIT_MIN_FREE_BYTES";
45
45
  export const LOW_DISK_FLOOR_BYTES = 5 * 1024 * 1024 * 1024;
46
46
  export const LOW_DISK_FLOOR_FRACTION = 0.05;
47
+ /**
48
+ * The percent part stops growing here (BLI-23183). The fleet's own heartbeat numbers showed the 5% rule putting a
49
+ * 930 GB Windows desktop at a 46.5 GB floor with 44.2 GB free: paused, and RED on the board, on a disk nobody would
50
+ * call full. The fixed 5 GiB part already protects the operating system; 20 GiB is the share of a big disk Tower
51
+ * leaves alone, and a 228 GB Mac (floor 11.4 GB) is unchanged.
52
+ */
53
+ export const LOW_DISK_FLOOR_MAX_BYTES = 20 * 1024 * 1024 * 1024;
47
54
  /**
48
55
  * A file at most this fraction of the free space left is never refused for low
49
56
  * disk: a 7 MB upload does not threaten a volume with gigabytes free, even one
@@ -101,7 +108,8 @@ pathApi = path) {
101
108
  export function lowDiskFloorBytes(totalBytes, override) {
102
109
  if (override !== null)
103
110
  return override;
104
- return Math.max(LOW_DISK_FLOOR_BYTES, Math.ceil(totalBytes * LOW_DISK_FLOOR_FRACTION));
111
+ const percentPart = Math.min(LOW_DISK_FLOOR_MAX_BYTES, Math.ceil(totalBytes * LOW_DISK_FLOOR_FRACTION));
112
+ return Math.max(LOW_DISK_FLOOR_BYTES, percentPart);
105
113
  }
106
114
  /**
107
115
  * Everything the collector writes under its state dir, studies excluded: the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bli-cockpit/cli",
3
- "version": "0.2.285",
3
+ "version": "0.2.286",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {