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

Rescue Database errors during active_record.define_attribute_methods #40119

Merged

Conversation

casperisfine
Copy link
Contributor

Followup: #40110 and #40108

This initializer should be best effort. If for some reason the database in unhealthy, it is better to move forward with the boot process than to crash.

Ideally if the schema cache dump was loaded, we should be able to define the attribute methods without having to connect to the database, however define_attribute_methods call various methods that access the schema cache through Base.connection which does immediately connect to the database. I'd like to refactor that, but it's much more work. So short term handling errors is the best we can do.

cc @rafaelfranca @Edouard-chin

This initializer should be best effort. If for some reason the
database in unhealthy, it is better to move forward with the
boot process than to crash.
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

Successfully merging this pull request may close these issues.

None yet

3 participants