Replies: 2 comments
-
https://thoughtbot.com/blog/rescue-standarderror-not-exception I think mongoid should have a really good reason to be rescuing |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks for the report @rpeng and comment @edmund-huber. I've opened MONGOID-5463 for our team to triage this issue. Once this has been reviewed further updates will be shared via Jira. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Would it be possible to change this to allow certain exceptions to re-raise?
mongoid/lib/rails/mongoid.rb
Line 50 in 94fdc7d
Many rails apps pre-load mongo models, and a lot use Zeitwerk to perform the loading. Sometimes, applications will receive SIGTERMs or SIGINTs on startup, and if mongoid happens to be preloading models, this exception would be caught and ignored. This essentially swallows the signal and allows the application to continue booting, even though the framework is in an inconsistent state (e.g. half way through pre-loading).
This also can explain why certain rails users are seeing
NameErrors
/ uninitialized constants / Zeitwerk load errors.An example would be like so:
Beta Was this translation helpful? Give feedback.
All reactions