Skip to content

whp: a killed h9 process stays alive after its lock is released #376

Done

Description

@progrium

Found by minipg's stress suite in a cross-platform test round on AWS against hyper9 22d395c (progrium/minipg#27). Windows, WHP backend.

What happens

minipg's crash tests kill minipg.exe (which embeds h9 and runs Postgres in a WHP machine) and then check that no processes remain. On Windows, the killed process releases its lock, but the process itself stays alive for a while afterwards. The crash tests then fail with "processes remain". There were 40 of these failures in the round.

The likely cause is the WHP machine teardown: something in tearing down the partition or its vCPU threads keeps the process from exiting after it's been told to die. This hasn't been confirmed by looking at the process (for example, which threads are still alive or what they're blocked on).

Expected

Once the process is killed, it's gone promptly, as on Linux (KVM, sud) and Mac (HVF), where these crash tests pass.

Evidence

The logs from this round are on the h9dev machine in ~/minipg-test/results4/. The "processes remain" failures are in windows/stress.log.

Next steps

  • Reproduce, and while the process is lingering, dump its threads' stacks (Process Explorer or procdump) to see what is blocking exit, for example a vCPU thread stuck in WHvRunVirtualProcessor or a wait during WHvDeletePartition.

Activity

  1. progrium commented on Nov 28, 2026

    @progrium
    OwnerAuthor

    This looks like a problem in minipg's test rather than in h9. The stress suite's waitStopped checked for leftover processes as soon as the .pgdb lock was free. On Windows the lock is released when the killed process's handles close, which happens before the process itself has exited. After TerminateProcess the process can still be tearing down its address space, which here includes the WHP machine's committed guest memory. That's gigabytes, so the process can linger a while.

    progrium/minipg#28 (commit c384674) now gives the processes up to 15 s to exit after the lock is released, and logs how long they took. It still fails if a process is left after that. If the Windows round still shows "processes remain" with this change, the process really is stuck, and the thread-stack dump suggested above is the next step.


    Generated by Claude Code

  2. added a commit that references this issue on Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions