Skip to content

fix: Fix zombie process spawning from shell PATH resolution#1435

Merged
charlesvien merged 1 commit intomainfrom
04-01-fix_zombie_process_spawning_from_shell_path_resolution
Apr 2, 2026
Merged

fix: Fix zombie process spawning from shell PATH resolution#1435
charlesvien merged 1 commit intomainfrom
04-01-fix_zombie_process_spawning_from_shell_path_resolution

Conversation

@charlesvien
Copy link
Copy Markdown
Member

@charlesvien charlesvien commented Apr 1, 2026

Problem

fixPath() using execSync with -ilc causes thousands of zombie processes on macOS. The 5s timeout only kills the parent shell, orphaning all children.

Closes #1399

Changes

  1. Switch from execSync -ilc to spawnSync -lc to skip .zshrc plugin loading
  2. Add killSignal: "SIGKILL" to kill the entire process group on timeout
  3. Set POSTHOG_CODE_RESOLVING_ENVIRONMENT env var so users can fast-exit their shell config
  4. Cache resolved PATH to shell-env-cache.json with 1-hour TTL to skip shell spawn on subsequent launches

How did you test this?

Manually

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@charlesvien charlesvien changed the title Fix zombie process spawning from shell PATH resolution fix: Fix zombie process spawning from shell PATH resolution Apr 1, 2026
@charlesvien charlesvien marked this pull request as ready for review April 1, 2026 23:56
@charlesvien charlesvien merged commit b6832ad into main Apr 2, 2026
16 checks passed
@charlesvien charlesvien deleted the 04-01-fix_zombie_process_spawning_from_shell_path_resolution branch April 2, 2026 00:31
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.

Stop leaking hundreds of zombie processes

3 participants