EXPERIMENT: Remove no-op --min-disk-free=1024 from database run-queries

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>
This commit is contained in:
Henry Mercer
2026-08-20 16:15:12 +01:00
parent 9ee088e136
commit 14321a7eb0
3 changed files with 1 additions and 4 deletions

2
lib/entry-points.js generated
View File

@@ -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"], {

View File

@@ -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.`,
},

View File

@@ -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"], {