Re: [PATCH v6 2/2] tr2: log parent process name
- From
- Jeff Hostetler <git@jeffhostetler.com>
- Date
- Aug 2, 2021, 15:23 UTC
- Message-ID
- <48a62d5e-28e2-7103-a5bb-5db7e197a4b9@jeffhostetler.com>
- In-Reply-To
- <87o8agp29o.fsf@evledraar.gmail.com>
On 8/2/21 6:22 AM, Ævar Arnfjörð Bjarmason wrote: ...
Show 5 quoted lines
> > If anything the existing Windows version seems a bit unweildy, having to > apparently deal with cycles etc., I don't think that happens under > procfs, but maybe I'm missing some special-case. >
It's been a while since I did the parent lookup on Windows, but...
Yes, on Windows we observed cases where a PID would be recycled and a child process could have the same PID as an ancient ancestor that had long since exited.
I don't think the cycle problem exists on Unix because IIRC a child process' parent-PID is set to Init when the parent exits.
Windows does not update the child's parent-PID when the parent exits, so if a recently-used PID is given to one of our child processes, we can get a loop.
Jeff