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

[macOS] Plagued by ZombieProcesses #1765

Closed
michaelaye opened this issue May 24, 2020 · 2 comments
Closed

[macOS] Plagued by ZombieProcesses #1765

michaelaye opened this issue May 24, 2020 · 2 comments

Comments

@michaelaye
Copy link

Platform

  • macOS 10.14.6
  • psutil version: 5.7.0
  • Python 3.7.6

Bug description
When using Jupyterlab I am currently plagued by psutil.ZombieProcess raisings, (maybe similar to #1044 ? ):

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/psutil/_common.py", line 449, in wrapper
    ret = self._cache[fun]
AttributeError: _cache

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/psutil/_psosx.py", line 352, in catch_zombie
    yield
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/psutil/_psosx.py", line 393, in _get_pidtaskinfo
    ret = cext.proc_pidtaskinfo_oneshot(self.pid)
ProcessLookupError: [Errno 3] No such process (originated from proc_pidinfo())

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/tornado/ioloop.py", line 743, in _run_callback
    ret = callback()
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/tornado/ioloop.py", line 767, in _discard_future_result
    future.result()
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/tornado/gen.py", line 191, in wrapper
    result = func(*args, **kwargs)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/nbresuse/prometheus.py", line 34, in __call__
    metrics = self.apply_memory_limits(memory_metrics())
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/nbresuse/metrics.py", line 24, in memory_metrics
    rss = sum([p.memory_info().rss for p in all_processes])
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/nbresuse/metrics.py", line 24, in <listcomp>
    rss = sum([p.memory_info().rss for p in all_processes])
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/psutil/_common.py", line 452, in wrapper
    return fun(self)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/psutil/__init__.py", line 1070, in memory_info
    return self._proc.memory_info()
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/psutil/_psosx.py", line 334, in wrapper
    return fun(self, *args, **kwargs)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/psutil/_psosx.py", line 462, in memory_info
    rawtuple = self._get_pidtaskinfo()
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/psutil/_psosx.py", line 334, in wrapper
    return fun(self, *args, **kwargs)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/psutil/_common.py", line 452, in wrapper
    return fun(self)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/psutil/_psosx.py", line 393, in _get_pidtaskinfo
    ret = cext.proc_pidtaskinfo_oneshot(self.pid)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/contextlib.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/psutil/_psosx.py", line 363, in catch_zombie
    raise ZombieProcess(proc.pid, proc._name, proc._ppid)
psutil.ZombieProcess: psutil.ZombieProcess process still exists but it's a zombie (pid=90915)
LabApp - ERROR - Exception in callback functools.partial(<bound method IOLoop._discard_future_result of <tornado.platform.asyncio.AsyncIOMainLoop object at 0x10fd47790>>, <Future finished exception=psutil.ZombieProcess process still exists but it's a zombie (pid=91336)>)
Traceback (most recent call last):
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/psutil/_common.py", line 449, in wrapper
    ret = self._cache[fun]
AttributeError: 'Process' object has no attribute '_cache

after this the same error loop starts.

Test results
{ output of python -c psutil.tests (failures only, not full result) }

$ python -c "import psutil; psutil.tests()"                                               
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: module 'psutil' has no attribute 'tests'
@michaelaye michaelaye added the bug label May 24, 2020
@giampaolo
Copy link
Owner

What does this code do?
Also, ZombieProcess is a legitimate exception... if the process is a zombie. Is it? You can check with proc.status() == "zombie".

@michaelaye
Copy link
Author

I don’t know what this does, it just appears in my Jupyter lab console. I guess I will report there.

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

2 participants