Skip to content
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

os.readlink can return errno.ESRCH #503

Closed
giampaolo opened this issue May 23, 2014 · 1 comment
Closed

os.readlink can return errno.ESRCH #503

giampaolo opened this issue May 23, 2014 · 1 comment

Comments

@giampaolo
Copy link
Owner

From [email protected] on May 08, 2014 04:04:21

Traceback (most recent call last):
  File "/usr/local/bin/thermos_observe/twitter/common/exceptions/__init__.py", 
line 126, in _excepting_run
  File "/usr/local/bin/thermos_observe/twitter/aurora/observer/mesos_vars.py", 
line 510, in run
  File "/usr/local/bin/thermos_observe/twitter/aurora/observer/mesos_vars.py", 
line 314, in collect
  File "/usr/local/bin/thermos_observe/twitter/aurora/observer/mesos_vars.py", 
line 324, in collect_slaves
  File 
"/root/.pex/install/3c8008ea22662d5ffd7a5f0b056c41fdc13c1c49/psutil-1.1.2-py2.6-linux-x86_64.egg/psutil/_common.py",
 line 48, in __get__
    ret = self.func(instance)
  File 
"/root/.pex/install/3c8008ea22662d5ffd7a5f0b056c41fdc13c1c49/psutil-1.1.2-py2.6-linux-x86_64.egg/psutil/__init__.py",
 line 380, in exe
    exe = self._platform_impl.get_process_exe()
  File 
"/root/.pex/install/3c8008ea22662d5ffd7a5f0b056c41fdc13c1c49/psutil-1.1.2-py2.6-linux-x86_64.egg/psutil/_pslinux.py",
 line 480, in get_process_exe
    exe = os.readlink("/proc/%s/exe" % self.pid)
OSError: [Errno 3] No such process: '/proc/563/exe' 


Happens on Python 2.6.8, Linux x86_64 2.6.50 custom kernel. Verified that this 
code is unchanged in 2.1.1.

It looks like os.readlink('/proc/pid/exe') actually raises OSError errno.ESRCH 
instead of errno.ENOENT when it races.

This is fairly rare -- the code runs on many, many machines and we've only 
experienced this issue a handful of times.

Original issue: http://code.google.com/p/psutil/issues/detail?id=503

@giampaolo
Copy link
Owner Author

From g.rodola on May 08, 2014 08:36:05

Thanks. Fixed in revision 1c6aac966b4f .

Status: FixedInHG
Labels: OpSys-Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant