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.
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.
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:
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
atpassenger/src/ruby_supportlib/phusion_passenger/admin_tools/memory_stats.rb
Line 297 in 9a4acaf
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.
The text was updated successfully, but these errors were encountered: