Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Prefer os.Process.Signal to syscall.Kill
This protects us from a potential (but rare) race condition where 1. the process we are trying to signal terminates of its own accord 2. its PID gets reaped in the os.Process.Wait call 3. a new process with the same PID gets spawned before our signal actually gets sent. This is achieved by using the higher-level os.Process API directly, which has some synchronization to prevent os.Process.Wait and os.Process.Signal from racing.
- Loading branch information