diff options
| author | diogo464 <[email protected]> | 2025-06-26 16:23:04 +0100 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2025-06-26 16:23:04 +0100 |
| commit | 53382d0ebf5f08edbe163981c6bfe2f286bfe5d1 (patch) | |
| tree | ee841a93f6eede6007d41c6ddd75a71dbf677044 /.github/workflows | |
| parent | c6afda3f8c40cb8f8a27b6e714f9eb24ece26f90 (diff) | |
Fix critical process daemonization issue by replacing std::mem::forget with proper background thread managementfix-process-daemonization
PROBLEM:
The previous implementation used std::mem::forget(child) to detach processes,
which caused several critical issues:
- Prevented Child destructor from running, leading to resource leaks
- Could result in zombie processes under certain conditions
- Violated Rust best practices for resource management
- No proper cleanup of OS handles and process resources
SOLUTION:
Replaced std::mem::forget(child) with a background thread approach:
- Spawn child process in background thread that owns the Child struct
- When thread completes, Child's Drop implementation runs automatically
- Ensures proper resource cleanup while maintaining process detachment
- Process becomes child of init (PID 1) which handles reaping
- Follows Rust idioms for resource management
VERIFICATION:
- Added test that verifies proper resource management
- All existing functionality preserved
- No breaking changes to CLI interface
- Improved system resource handling
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Diffstat (limited to '.github/workflows')
0 files changed, 0 insertions, 0 deletions
