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

passenger-memory-stats - No such process @ io_fread (Errno::ESRCH) #2305

Closed
paul-e-allen opened this issue Sep 4, 2020 · 2 comments
Closed

Comments

@paul-e-allen
Copy link

Issue report

Question 1: What is the problem?

We run passenger-memory-stats every minute on our servers to create metrics for dashboarding and monitoring. Occasionally (~1-2 times per month) we see the following error:

/var/lib/gems/2.5.0/gems/passenger-6.0.1/src/ruby_supportlib/phusion_passenger/admin_tools/memory_stats.rb:286:in `read': No such process @ io_fread - /proc/6090/smaps (Errno::ESRCH)
from /var/lib/gems/2.5.0/gems/passenger-6.0.1/src/ruby_supportlib/phusion_passenger/admin_tools/memory_stats.rb:286:in `determine_private_dirty_rss'
from /var/lib/gems/2.5.0/gems/passenger-6.0.1/src/ruby_supportlib/phusion_passenger/admin_tools/memory_stats.rb:275:in `block in list_processes'
from /var/lib/gems/2.5.0/gems/passenger-6.0.1/src/ruby_supportlib/phusion_passenger/admin_tools/memory_stats.rb:255:in `each'
from /var/lib/gems/2.5.0/gems/passenger-6.0.1/src/ruby_supportlib/phusion_passenger/admin_tools/memory_stats.rb:255:in `list_processes'
from /var/lib/gems/2.5.0/gems/passenger-6.0.1/src/ruby_supportlib/phusion_passenger/admin_tools/memory_stats.rb:92:in `passenger_processes'
from /var/lib/gems/2.5.0/gems/passenger-6.0.1/bin/passenger-memory-stats:133:in `start'
from /var/lib/gems/2.5.0/gems/passenger-6.0.1/bin/passenger-memory-stats:178:in `<top (required)>'
from /usr/local/bin/passenger-memory-stats:23:in `load'
from /usr/local/bin/passenger-memory-stats:23:in `<main>'

We cannot reliably reproduce the error. A code analysis suggests that the error occurs when a passenger process ends in between the time that the tool gets the list of processes and collects information about those processes.

A brief look at the code for the memory stats script suggests that the rescue at

should simply also include Errno::ESRCH.

Question 2: Passenger version and integration mode:

Enterprise 6.0.1; Apache/2.4.29 (Ubuntu)

Question 3: OS or Linux distro, platform (including version):

Ubuntu 18.04.5 LTS

Question 4: Passenger installation method:

[ ] RubyGems + Gemfile
[ ] RubyGems, no Gemfile
[ ] Phusion APT repo
[ ] Phusion YUM repo
[ ] OS X Homebrew
[ ] source tarball
[ X] Other, please specify: https://supermarket.chef.io/cookbooks/passenger_apache2 Chef recipe

Question 5: Your app's programming language (including any version managers) and framework (including versions):

This is not occurring within any of our apps, but in the main passenger service tooling.

Question 6: Are you using a PaaS and/or containerization? If so which one?

No

Question 7: Anything else about your setup that we should know?

If you think that the fix suggested above makes sense, we'd be happy to create a pull request.

@CamJN
Copy link
Contributor

CamJN commented Sep 14, 2020

I agree with your assesment, and would be happy to review a PR. Just a heads up that we require folks to sign our contributor agreement to submit PRs. Otherwise I can just make the change myself.

@paul-e-allen
Copy link
Author

Since you offered, and for purposes of expediency, please go ahead and make the change yourself.

Thank you!

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

No branches or pull requests

3 participants