Skip to content

Fix the AWS round's minipg bugs: linked root cache, Windows memory, status after a kill - #28

Merged
progrium merged 1 commit into
claude/project-thread-s07mk5from
claude/project-thread-aru07y
Nov 28, 2026
Merged

progrium merged 1 commit into
claude/project-thread-s07mk5from
claude/project-thread-aru07y

Conversation

@progrium

@progrium progrium commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

Requested by Jeff · project thread

This is stacked on #27 and fixes the minipg-side failures from the cross-platform round on the AWS hosts.

Changes

  • NotDir with a linked root cache (macOS and Windows e2e). When the roots directory was a symlink or a junction, which shareRoots() creates, init failed with NotDir. Zig's createDirPath checks an existing path with SYMLINK_NOFOLLOW, so it treats a link to a directory as "not a directory". The new paths.makeDirPath accepts a path that opens as a directory, and roots.zig, registry.zig and makePrivateDir now use it. I reproduced the bug on Linux with the old binary (minipg: NotDir) and confirmed the fix. Covered by a unit test and a new Linux e2e test, TestLinkedRootCache.
  • OutOfGuestMemory on Windows restarts. WHP commits a machine's whole memory up front, and with 100 connections that's 5 GB per server.
    • On Windows, new clusters get max_connections = 20 through initdb -c (Postgres 16 and later, unless POSTGRES_INITDB_ARGS already sets it). That fits the 2 GB minimum machine.
    • If a server start still hits OutOfGuestMemory on Windows, it waits up to 20 s for a just-killed server's memory to be freed before giving up, and logs that it is waiting.
    • A .pgdb made before this change keeps its 100 connections. MANUAL.md documents the new default and how to raise it.
  • status right after a SIGKILL (the TestCrashRecovery flake). A server can die between find() and the control request. Its socket then returns Protocol or NotRunning, and its pid can briefly outlive it. status now looks for the server again for up to 5 s and reports stopped once the server is gone. A refusal or a protocol mismatch from a live server is still an error.
  • TestEnvAndRun now expects PowerShell syntax ($env:NAME = '...') on Windows.
  • Stress "processes remain" on Windows (whp: a killed h9 process stays alive after its lock is released hyper9#376). waitStopped checked for leftover processes as soon as the lock was free. On Windows the lock is released when the killed process's handles close, which happens before the process exits while it is still tearing down its committed guest memory. The test now gives the processes up to 15 s to exit, logs how long they took, and still fails if any remain after that.

Testing

Linux x86_64, no KVM, so the sud engine:

  • zig build test passes.
  • e2e: 18 of 18 pass (TestFetch is skipped as usual), including the new TestLinkedRootCache.
  • TestStressCrash with 1 round: all 6 kill modes pass.
  • go vet passes with the stress tag for linux, windows and darwin.
  • The Windows (x86_64) build compiles. The aarch64-macos build compiles but can't link here, because the Hypervisor framework isn't available.
  • Not yet run on the AWS macOS and Windows hosts.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LLcnT1b3qE5wAs51zmrZA5

…nv test, status after a kill

- A root cache directory that is a symlink or junction no longer fails
  with NotDir: std's createDirPath checks an existing path without
  following a final link, so paths.makeDirPath accepts one that opens as
  a directory. Unit test, and a Linux e2e test (TestLinkedRootCache).
- Windows: new clusters get max_connections 20 (initdb -c, Postgres 16+),
  a 2 GB machine instead of 5 GB, since WHP commits it all up front. A
  server start that finds no guest memory free waits up to 20 s for a
  just-killed server's to be released.
- status retries when the server dies between being found and asked
  (Protocol or NotRunning from its socket), and reports it stopped.
- TestEnvAndRun expects PowerShell syntax on Windows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LLcnT1b3qE5wAs51zmrZA5
@progrium progrium self-assigned this Nov 28, 2026
@progrium
progrium merged commit 9e5f871 into claude/project-thread-s07mk5 Nov 28, 2026
3 checks passed
progrium added a commit that referenced this pull request Nov 29, 2026
…a kill, env test (#29)

* Fix the AWS round's minipg bugs: linked root cache, Windows memory, env test, status after a kill

- A root cache directory that is a symlink or junction no longer fails
  with NotDir: std's createDirPath checks an existing path without
  following a final link, so paths.makeDirPath accepts one that opens as
  a directory. Unit test, and a Linux e2e test (TestLinkedRootCache).
- Windows: new clusters get max_connections 20 (initdb -c, Postgres 16+),
  a 2 GB machine instead of 5 GB, since WHP commits it all up front. A
  server start that finds no guest memory free waits up to 20 s for a
  just-killed server's to be released.
- status retries when the server dies between being found and asked
  (Protocol or NotRunning from its socket), and reports it stopped.
- TestEnvAndRun expects PowerShell syntax on Windows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LLcnT1b3qE5wAs51zmrZA5

* stress: give a killed server's processes time to exit after its lock goes

On Windows the lock is released when the dead process's handles close,
which comes before the process itself is gone: it lingers while its
address space, the WHP machine's committed guest memory, is torn down.
waitStopped checked for leftover processes the moment the lock was free,
and so failed 40 times in the AWS round ("processes remain",
progrium/hyper9#376). It now waits up to 15s for them, and logs how long
they took.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LLcnT1b3qE5wAs51zmrZA5

---------

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants