Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
skip reading the stat files of processes that have exited.
there is a race between listing all the /proc/pid dirs and reading the stat files in those dirs. try/except'ing each stat file individually fixes this race. there remains the corner case where the pid we are searching for is one of those that has exited. this is detected and [] is returned. this function's previous fall-through of returning None in case of any problems was not understood by callers. this caused many errors in abrt/syslog of the form [PYTHON] Can't call the metric handler function for [procstat_*_cpu] in the python module [procstat]. see eg. ganglia/gmond_python_modules#114 by always returning [] in the worst case we solve that problem.
- Loading branch information