Skip to content

Add terminate-on-parent-exit subprocess option - #111

Open
sheredom wants to merge 1 commit into
mainfrom
feature/terminate-on-parent-exit
Open

sheredom wants to merge 1 commit into
mainfrom
feature/terminate-on-parent-exit

Conversation

@sheredom

Copy link
Copy Markdown
Owner

Summary

  • add subprocess_option_terminate_on_parent_exit to terminate a managed subprocess tree when its parent exits
  • use a kill-on-close Job Object and atomic PROC_THREAD_ATTRIBUTE_JOB_LIST assignment on Windows 10+
  • use a dedicated process group, parent-lifeline pipe, and watchdog on POSIX without moving the caller into the managed group
  • make subprocess_destroy terminate opted-in running process trees
  • document platform behavior and the POSIX process-group escape limitation
  • add parent-exit, explicit-destroy, descendant, and failure-cleanup coverage

Rationale

The process-group design incorporates the lesson from Apache Commons Daemon DAEMON-232 and commit cab468ff, which removed jsvc's unconditional startup setpgrp/setpgid behavior because it interfered with supervisors that signal logical process groups.

The POSIX watchdog also closes its own lifeline write descriptor before waiting for EOF, matching the failure mode fixed by OpenJDK JDK-8307990.

Testing

  • ctest --test-dir build --output-on-failure
    • subprocess_test
    • subprocess_address_test
    • subprocess_undefined_test
    • subprocess_thread_test
  • MinGW x86-64 C compilation and C++ Windows-header include-order checks

All four local macOS CTest targets pass. Windows runtime and Linux behavior are covered by the repository CI matrix.


馃 Conjured by AI via pi.dev using gpt-5.6-sol

@sheredom
sheredom force-pushed the feature/terminate-on-parent-exit branch 3 times, most recently from aa8ff91 to c4a9b31 Compare August 21, 2026 14:10
馃 Conjured by AI via [pi.dev](https://pi.dev/) using gpt-5.6-sol
@sheredom
sheredom force-pushed the feature/terminate-on-parent-exit branch from c4a9b31 to f4963d3 Compare August 21, 2026 14:14
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.

1 participant