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
Once this program goes to what I think is the top-level,
it still returns a parent pid - but won't access the parent process.
For example, running this code returns a log similar to this:
python, pid 49000, ppid 45636
python, pid 45636, ppid 40208
bash, pid 40208, ppid 21072
bash, pid 21072, ppid 54124
cmd, pid 54124, ppid 46588
git-bash, pid 46588, ppid 10116
explorer, pid 10116, ppid 10036
and then, it's unable to find a process with pid 10036.
Using .parent() simply returns None,
whereas .Process(ppid) returns an Exception NoSuchProcess.
My assumption for the cause of the problem is Access Permission,
but I'm confused because .ppid() should return with an Exception describing Access Denied if that was the case. This goes the same with .parent(), or .Process(ppid).
If this really is a problem related with access permission,
why would it not say so?
is there a way to get access permission?
If it's not, can anybody shed a light on what may be the problem?
The text was updated successfully, but these errors were encountered:
Currently there's not enough information when the agent shutdown. Also, it seems like psutil.parent is not always correct. So as short-term mitigation, I tried making termination more graceful (it has 5 loops (10 s) before it considers the parent as dead). Maybe it'd be better if we send a heartbeat than checking the process directly using psutil as well...
giampaolo/psutil#1905
…t#29540)
Currently there's not enough information when the agent shutdown. Also, it seems like psutil.parent is not always correct. So as short-term mitigation, I tried making termination more graceful (it has 5 loops (10 s) before it considers the parent as dead). Maybe it'd be better if we send a heartbeat than checking the process directly using psutil as well...
giampaolo/psutil#1905
Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
Summary
Description
I'm trying to write a program that finds ALL parent processes of a process.
My code is this:
The problem I've noticed:
Once this program goes to what I think is the top-level,
it still returns a parent pid - but won't access the parent process.
For example, running this code returns a log similar to this:
and then, it's unable to find a process with pid 10036.
Using .parent() simply returns
None
,whereas .Process(ppid) returns an Exception
NoSuchProcess
.My assumption for the cause of the problem is Access Permission,
but I'm confused because .ppid() should return with an Exception describing Access Denied if that was the case. This goes the same with .parent(), or .Process(ppid).
If this really is a problem related with access permission,
If it's not, can anybody shed a light on what may be the problem?
The text was updated successfully, but these errors were encountered: