Closed schuylr closed 4 years ago
I spun up a reproduction environment and tried to reproduce this issue at-will, but can't find anything that exposes the problem. I'll close this for now until I'm more certain there's an issue with passenger.
I spun up a reproduction environment and tried to reproduce this issue at-will, but can't find anything that exposes the problem. I'll close this for now until I'm more certain there's an issue with passenger.
Were you ever able to resolve this issue? I've encountered the exact same situation.
Hi @jforkan - I'm no longer with the business with this environment, and did not have a clear smoking gun to solving this issue. I would suggest opening a new ticket.
Hi @jforkan - I'm no longer with the business with this environment, and did not have a clear smoking gun to solving this issue. I would suggest opening a new ticket.
FYI Looks like this has been resolved in mongo driver 2.16.1 and testing confirms it is no longer an issue in my environment. See https://jira.mongodb.org/browse/RUBY-2806
Issue report
When our MongoDB Atlas Cluster performs a fail-over (primary node restarts and elects a secondary node), the running web application fails to reload the Mongo client connections correctly, and reports these exceptions on the application level:
Are you sure this is a bug in Passenger?
We've been working with MongoDB Support for over a month triaging the Mongo Ruby driver, Mongoid, and other various possibilities related to the Ruby gems. What we know so far (each test case was performed with a manual fail-over, which is reproducible with Rails running in Passenger):
bin/rails c
and Mongoid clients loadedPlease try with the newest version of Passenger to avoid issues that have already been fixed
I checked the changelogs since 6.0.4 and don't see anything that would indicate a fix for Mongo connections.
Question 1: What is the problem?
When Mongo Atlas clusters perform a fail-over, Mongoid should be able to reconnect to the cluster automatically
The reconnection does not occur, and can only be fixed by restarting the application running on Passenger.
I'll work on creating a Docker image + Rails that should reproduce it, in case these reproduction steps don't work for you:
Question 2: Passenger version and integration mode:
Question 3: OS or Linux distro, platform (including version):
Question 4: Passenger installation method:
Your answer: [ ] RubyGems + Gemfile [ ] RubyGems, no Gemfile [ ] Phusion APT repo [ ] Phusion YUM repo [ ] OS X Homebrew [ ] source tarball [x] Other, please specify: Rubygems + RVM + passenger-install-nginx-module
Question 5: Your app's programming language (including any version managers) and framework (including versions):
Question 6: Are you using a PaaS and/or containerization? If so which one?
Question 7: Anything else about your setup that we should know?
We have followed the Mongoid documentation where we should be performing client reconnections on smart spawning. Here is our
config.ru
file:Happy to provide anything else that may be relevant.