4ea4f2 core: reduce the number of stalled PIDs from the watched processes list when possible

11 files Authored by Franck Bui 4 years ago, Committed by Packit Service 4 years ago,
    core: reduce the number of stalled PIDs from the watched processes list when possible
    
    Some PIDs can remain in the watched list even though their processes have
    exited since a long time. It can easily happen if the main process of a forking
    service manages to spawn a child before the control process exits for example.
    
    However when a pid is about to be mapped to a unit by calling unit_watch_pid(),
    the caller usually knows if the pid should belong to this unit exclusively: if
    we just forked() off a child, then we can be sure that its PID is otherwise
    unused. In this case we take this opportunity to remove any stalled PIDs from
    the watched process list.
    
    If we learnt about a PID in any other form (for example via PID file, via
    searching, MAINPID= and so on), then we can't assume anything.
    
    Thanks Renaud Métrich for backporting this to RHEL.
    Resolves: #1744972
    
    patch_name: 0232-core-reduce-the-number-of-stalled-PIDs-from-the-watc.patch
    present_in_specfile: true
    location_in_specfile: 232
    squash_commits: true
    
        
file modified
+1 -1
file modified
+1 -1
file modified
+10 -0
file modified
+2 -0
file modified
+2 -3
file modified
+8 -8
file modified
+3 -4
file modified
+2 -3
file modified
+7 -1
file modified
+1 -1
file modified
+6 -6