sschiffli opened a new pull request, #617:
URL: https://github.com/apache/guacamole-server/pull/617

   ## Problem
   Guacamole daemon was not properly cleaning up orphaned client sub-processes, 
leading to zombie processes that accumulate over time and consume system 
resources.
   
   ## Root Cause
   - Daemon did not adopt orphaned processes when parent client processes 
terminated unexpectedly
   - Process termination only killed individual processes instead of entire 
process groups
   - This left child processes running as orphans that couldn't be properly 
reaped
   
   ## Solution
   Implemented comprehensive process lifecycle management:
   
   1. **Added subreaper capability**: Configure daemon with 
`prctl(PR_SET_CHILD_SUBREAPER, 1)` to automatically adopt any orphaned client 
processes
   2. **Process group termination**: Changed termination signal from 
`kill(proc->pid, SIGTERM)` to `kill(-proc->pid, SIGTERM)` to terminate entire 
process groups
   3. **Proper cleanup chain**: Ensures all child processes are properly reaped 
when connections terminate
   
   ## Impact
   - Prevents zombie process accumulation
   - Improves system resource management
   - Ensures clean process termination in all scenarios
   - Maintains compatibility with existing process group creation (`setpgid(0, 
0)`)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to