Skip to content

fix: use kill_on_drop() to avoid zombie proc in error case#887

Merged
SteveLauC merged 1 commit intomainfrom
fix/zombie_proc
Aug 26, 2025
Merged

fix: use kill_on_drop() to avoid zombie proc in error case#887
SteveLauC merged 1 commit intomainfrom
fix/zombie_proc

Conversation

@SteveLauC
Copy link
Copy Markdown
Member

In the previous macOS file search implementation, we spawned an mdfind child process and killed it when we got the results we needed to avoid zombie processes. However, this kill step would be skipped if an error happened during query results processing as we propagate errors.

This commit replaces the manual kill operation with the ChildProcHandle.kill_on_drop() API to let RAII do the job to fix the issue.

Standards checklist

  • The PR title is descriptive
  • The commit messages are semantic
  • Necessary tests are added
  • Updated the release notes
  • Necessary documents have been added if this is a new feature
  • Performance tests checked, no obvious performance degradation

In the previous macOS file search implementation, we spawned an mdfind child
process and killed it when we got the results we needed to avoid zombie
processes.  However, this kill step would be skipped if an error happened
during query results processing as we propagate errors.

This commit replaces the manual kill operation with the `ChildProcHandle.kill_on_drop()`
API to let RAII do the job to fix the issue.
@SteveLauC SteveLauC merged commit 9504826 into main Aug 26, 2025
4 checks passed
@SteveLauC SteveLauC deleted the fix/zombie_proc branch August 26, 2025 09:26
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.

3 participants