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

Eagerly autoload ActiveJob::Base; clean up framework deferred-loading logic to use nested on_load blocks #931

Merged
merged 1 commit into from
Apr 22, 2023

Conversation

bensheldon
Copy link
Owner

@bensheldon bensheldon commented Apr 17, 2023

Reminded by #930 that I wanted to clean this up after learning about nested blocks in rails/rails#45476

Also, I added a reference to ActiveJob::Base. I hope that does not cause a deadlock, but inspecting this it does appear that once rails/rails#45476 is released in Rails 7.1, it's no longer guaranteed that an async executor will be initialized at startup unless both Active Record (which I think will happen because of of the Migration tracker) and Active Job (less likely to happen) are initialized.

Within GoodJob development, I noticed that some of the autoload behavior was masked by the gem activerecord-explain-analyze autoloading Active Record via this initializer in Rails: https://github.com/bensheldon/rails/blob/70d3b8760fb625d0ebc8b2d0482c45645d3bb7b8/activerecord/lib/active_record/railtie.rb#L88-L92

@bensheldon bensheldon force-pushed the async_ready branch 3 times, most recently from e33653c to 888d78c Compare April 18, 2023 02:08
…cks; defer loading development gem `activerecord-explain-analyze`
@bensheldon bensheldon changed the title Clean up framework deferred-loading logic to use nested on_load blocks; defer loading development gem activerecord-explain-analyze Eager autoload ActiveJob::Base; clean up framework deferred-loading logic to use nested on_load blocks; defer loading development gem activerecord-explain-analyze Apr 18, 2023
@bensheldon bensheldon changed the title Eager autoload ActiveJob::Base; clean up framework deferred-loading logic to use nested on_load blocks; defer loading development gem activerecord-explain-analyze Eagerly autoload ActiveJob::Base; clean up framework deferred-loading logic to use nested on_load blocks; defer loading development gem activerecord-explain-analyze Apr 18, 2023
@bensheldon bensheldon changed the title Eagerly autoload ActiveJob::Base; clean up framework deferred-loading logic to use nested on_load blocks; defer loading development gem activerecord-explain-analyze Eagerly autoload ActiveJob::Base; clean up framework deferred-loading logic to use nested on_load blocks Apr 18, 2023
@bensheldon bensheldon marked this pull request as ready for review April 18, 2023 14:13
@bensheldon bensheldon temporarily deployed to goodjob-async-ready-4m8ioidtip April 19, 2023 15:13 Inactive
@bensheldon bensheldon merged commit 1a98e1b into main Apr 22, 2023
@bensheldon bensheldon deleted the async_ready branch April 22, 2023 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

1 participant