From 14321a7eb01a5b5e85cb9016634f37fb7040770e Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Thu, 20 Aug 2026 16:15:12 +0100 Subject: [PATCH] EXPERIMENT: Remove no-op `--min-disk-free=1024` from `database run-queries` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a throwaway branch for a DCA disk-reserve experiment. Do not merge. The Action hardcoded `--min-disk-free=1024` when running queries, which is a no-op that duplicates the CLI's own default: - `StorageAmount.ofMegabytes(1024)` is `1024 << 20` == exactly 1 GiB, the same value as the `StorageAmount.ofGigabytes(1)` used by the CLI default. - When neither `--min-disk-free` nor `--min-disk-free-pct` is passed, `RelationCacheImpl` installs a default backstop of frac 0.1 plus a 1 GiB cap, and `Evictor.ensureSpaceOnDisk` takes the smaller of the two. On any file system of at least 10 GiB — i.e. all our runners — that resolves to exactly 1 GiB, so passing the flag sets precisely what the CLI would have chosen. Because the CLI rejects a repeated `--min-disk-free` ("should be specified only once", exit 2), the hardcoded occurrence made the flag impossible to set via `CODEQL_ACTION_EXTRA_OPTIONS`. Removing it leaves behaviour unchanged while letting the experiment inject its own disk reserve. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- lib/entry-points.js | 2 -- src/codeql.test.ts | 2 +- src/codeql.ts | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/entry-points.js b/lib/entry-points.js index 12bdf418f..e1dcaf650 100644 --- a/lib/entry-points.js +++ b/lib/entry-points.js @@ -152609,8 +152609,6 @@ async function getCodeQLForCmd(logger, cmd, checkVersion) { "run-queries", ...flags, databasePath, - "--min-disk-free=1024", - // Try to leave at least 1GB free "-v", ...queries, ...getExtraOptionsFromEnv(["database", "run-queries"], { diff --git a/src/codeql.test.ts b/src/codeql.test.ts index df4bafe29..7baf508e3 100644 --- a/src/codeql.test.ts +++ b/src/codeql.test.ts @@ -1037,7 +1037,7 @@ test.serial("runTool recognizes fatal internal errors", async (t) => { await codeqlObject.databaseRunQueries(stubConfig.dbLocation, []), { instanceOf: CliError, - message: `Encountered a fatal error while running "codeql-for-testing database run-queries --min-disk-free=1024 -v". Exit code was 1 and error was: Oops! A fatal internal error occurred. Details: + message: `Encountered a fatal error while running "codeql-for-testing database run-queries -v". Exit code was 1 and error was: Oops! A fatal internal error occurred. Details: com.semmle.util.exception.CatastrophicError: An error occurred while evaluating ControlFlowGraph::ControlFlow::Root.isRootOf/1#dispred#f610e6ed/2@86282cc8 Severe disk cache trouble (corruption or out of space) at /home/runner/work/_temp/codeql_databases/go/db-go/default/cache/pages/28/33.pack: Failed to write item to disk. See the logs for more details.`, }, diff --git a/src/codeql.ts b/src/codeql.ts index 117b0d8e6..bd1265521 100644 --- a/src/codeql.ts +++ b/src/codeql.ts @@ -766,7 +766,6 @@ async function getCodeQLForCmd( "run-queries", ...flags, databasePath, - "--min-disk-free=1024", // Try to leave at least 1GB free "-v", ...queries, ...getExtraOptionsFromEnv(["database", "run-queries"], {