You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at process_info.c, get_ppid() it seems that it does not consider PID
reuse, because it does not check if the found process has a creation time
smaller than or equal to the current process.
As a workaround: If process.parent returns a Process reference the creation
time of that process should be checked to ensure that the parent process is
older than or as old as the process (a sub-process can have the same creation
timestamp as its parent process, IIRC what a colleague once reported):
def my_get_ppid(process):
pp = process.parent
if pp is not None:
# Check if parent process is younger than
# process:
if pp.create_time > process.create_time:
return None
return pp.pid
def my_get_parent(process):
if my_get_ppid(process) is not None:
return process.parent
return None
Possibly related issue: https://code.google.com/p/psutil/issues/detail?id=314
From clackw...@googlemail.com on March 12, 2013 05:07:30
Original issue: http://code.google.com/p/psutil/issues/detail?id=356
The text was updated successfully, but these errors were encountered: