giampaolo / psutil

Cross-platform lib for process and system monitoring in Python
BSD 3-Clause "New" or "Revised" License
10.32k stars 1.39k forks source link

PID reusage is not checked for different set methods #2290

Closed giampaolo closed 1 year ago

giampaolo commented 1 year ago

Summary

Description

Doc states:

process identity is preemptively checked (via PID + creation time) is for the following methods: nice() (set), ionice() (set), cpu_affinity() (set), rlimit() (set), children(), parent(), parents(), suspend() resume(), send_signal(), terminate() kill().

It turns out we're currently doing this only for "kill" methods (suspend() resume(), send_signal(), terminate() kill()) and children(). We're not doing it for set methods:

Also, since we do it for parent(), we should also do it for parents() and ppid().