Fix crash due to zombie processes (#174)

This commit is contained in:
Julien Lamy 2019-02-01 01:32:27 +01:00 committed by Manuel Riel
parent eb50885371
commit beb3dc8909
1 changed files with 6 additions and 1 deletions

View File

@ -266,7 +266,12 @@ def format_archive_name(profile, archive_name_tpl):
def get_mount_points(repo_url):
mount_points = {}
for proc in psutil.process_iter():
if proc.name() == 'borg' or proc.name().startswith('python'):
try:
name = proc.name()
except Exception:
# Getting the process name may fail (e.g. zombie process on macOS)
continue
if name == 'borg' or name.startswith('python'):
if 'mount' not in proc.cmdline():
continue