-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Process.name() cache may be outdated #692
Comments
I have the same problem with checkpointing and restarting processes. During restart the process name is the name of the checkpoint/restart tool (CRIU) and once the process has been restored it changes to the program being restarted. So sometimes I get 'criu' as process name and sometimes the actual process name after the restore. It depends on the point in time at which the loop over psutil.process_iter() is run. |
The python module psutil caches the process name so that sometimes restored process have 'criu' as the process name. psutil uses the process' PID and start time to decide if the process name has to be updated. But as the start time does not change it will sometimes not change to the restored process name but it will keep listing the restore process as 'criu'. This is tracked at: giampaolo/psutil#692 Signed-off-by: Adrian Reber <areber@redhat.com>
The python module psutil caches the process name so that sometimes restored process have 'criu' as the process name. psutil uses the process' PID and start time to decide if the process name has to be updated. But as the start time does not change it will sometimes not change to the restored process name but it will keep listing the restore process as 'criu'. This is tracked at: giampaolo/psutil#692 Signed-off-by: Adrian Reber <areber@redhat.com>
The python module psutil caches the process name so that sometimes restored process have 'criu' as the process name. psutil uses the process' PID and start time to decide if the process name has to be updated. But as the start time does not change it will sometimes not change to the restored process name but it will keep listing the restore process as 'criu'. This is tracked at: giampaolo/psutil#692 Signed-off-by: Adrian Reber <areber@redhat.com>
This is now fixed in latest GIT version. |
psutil cache the process name based on (pid, creation_time), but in case of exec it could change.
I can reproduce this issue with:
The loop used is :
Note: the cmdline() - which is not cached - show the new name.
A way to request name without using cache may be valuable.
The text was updated successfully, but these errors were encountered: