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

catch psutil exceptions #113

Merged
merged 3 commits into from
Dec 2, 2021
Merged

Conversation

jhgoebbert
Copy link

@jhgoebbert jhgoebbert commented Nov 19, 2021

This MR fixes the issue that process collected in
all_processes = [cur_process] + cur_process.children(recursive=True)
can be invalid in the next line when summing their memory resources.
rss = sum([p.memory_info().rss for p in all_processes])

The psutil documentation mentions this as a side-note:
"When accessing methods of this class always be prepared to catch NoSuchProcess and AccessDenied exceptions."

(this is not a theoretical issue - we could see this problem at our site and were therefore tracking it down to fix it)

@welcome
Copy link

welcome bot commented Nov 19, 2021

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

Copy link
Member

@jtpio jtpio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jtpio jtpio merged commit bf688a9 into jupyter-server:master Dec 2, 2021
@welcome
Copy link

welcome bot commented Dec 2, 2021

Congrats on your first merged pull request in this project! 🎉
congrats
Thank you for contributing, we are very proud of you! ❤️

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

Successfully merging this pull request may close these issues.

2 participants