Skip to content

fix: contain mutation subprocesses - #93

Open
darksectorai wants to merge 3 commits into
sivchari:mainfrom
darksectorai:fix/mutation-process-containment
Open

fix: contain mutation subprocesses#93
darksectorai wants to merge 3 commits into
sivchari:mainfrom
darksectorai:fix/mutation-process-containment

Conversation

@darksectorai

Copy link
Copy Markdown

Summary

  • run mutation compilation and tests in bounded worker pools
  • propagate caller cancellation and CLI termination signals
  • terminate Unix process groups so timed-out test descendants cannot survive
  • cap captured output and set a configurable child Go memory target
  • reject duplicate mutant IDs and use collision-free overlay directories

Root cause

exec.CommandContext terminated the immediate go test process on timeout, but a spawned test binary could remain alive and continue consuming resources. Mutation runs also created one goroutine per mutant, compilation had no timeout, and command output was buffered without a limit.

The command runner now places Unix children in a dedicated process group and kills the group on cancellation. The mutation timeout covers both compilation and testing, and cancellation propagates from the Cobra root context through file processing.

Child Go processes receive GOMEMLIMIT=2GiB by default. Set GOMU_CHILD_GOMEMLIMIT to override it.

Validation

  • go test ./...
  • make test
  • make lint
  • regression test proving a spawned descendant does not survive timeout
  • regression tests for bounded output and memory-limit propagation

Portability

Unix platforms receive process-group termination. Other platforms retain direct-child termination behavior.

@darksectorai
darksectorai marked this pull request as ready for review July 11, 2026 23:28
mcgoughprogress added a commit to mcgoughprogress/gomu that referenced this pull request Aug 31, 2026
…inment

fix: contain mutation subprocesses (port of sivchari#93)
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