Closed Nukesor closed 2 years ago
Hi! You're absolutely right. This is a regression, sorry about that.
Taking this opportunity to think about what this API should do: is there any scenario in which a zombie process should be considered "alive"? I can't think of one. And if someone wants to distinguish a zombie from a fully reaped process, I think they can just check if its state is Zombie
.
If you want to make the PR for this, please feel free! Otherwise I'll make the fix and then I think I'll backport it to the 0.13 release as well
Thanks for the quick response and no worries :)
I just took a quick look at the other states and from what I understand only Zombie
and Dead
are considered dead.
I also agree that one has to look at the current state, if one wants to determine whether a process is Dead
or a Zombie
. The same goes for all other alive states.
It would be great, if you could take care of fixing this! I'm currently quite busy maintaining my own projects :sweat:.
Personally, I also don't need this fix in a timely manner. v0.12
is still working perfectly fine!
Thanks in advance!
No worries. I know that some people like to fix bugs that they report, so I wanted to give that opportunity to you. But I think you correctly understood that the offer was with no obligation at all :)
I'll work on the fix this week. Thanks again for reporting the issue!
Hi!
It looks like the behavior of
Process::is_alive
has changed. I'm not 100% sure if this was a deliberate change or a regression. As it wasn't documented in the Changelog, I assumed that this is indeed a bug.Previously,
Z
ombie processes weren't detected as alive. This however changed inv0.13
.A minimal reproducable example can be found over here: https://github.com/Nukesor/Debug/tree/procfs-zombie-process
The example spawns a
sleep 2
and checks theis_alive
function and the current process' state:From what I gathered,
Z
ombie processes shouldn't be considered alive.This change in behavior was introduced in
v0.13
.v0.12
worked as expected: