collectiveidea / delayed_job

Database based asynchronous priority queue system -- Extracted from Shopify
http://groups.google.com/group/delayed_job
MIT License
4.82k stars 956 forks source link

Error since ActiveSupport 7.0.3: `undefined method `silence_warnings' for Delayed::Worker:Class (NoMethodError)` #1168

Closed arielvalentin closed 2 years ago

arielvalentin commented 2 years ago

šŸ‘‹šŸ¼ We have identified incompatibility issue with DelayedJob 4 and ActiveSupport 7.0.3

It seems that [activesupport/lib/active_support/core_ext/kernel/reporting.rb](https://github.com/rails/rails/blob/78e402077d4d69b08db7daf8944a32eef0cf6ac4/activesupport/lib/active_support/core_ext/kernel/reporting.rb) may not be loaded when setting Delayed::Worker#backend, which results in a an error: undefined methodsilence_warnings' for Delayed::Worker:Class (NoMethodError)`

I have not identified the change but it does looking like this PR manually added reporting before loading delayed_job https://github.com/rails/rails/pull/44340/files.

https://github.com/rails/rails/blob/v7.0.3/activesupport/CHANGELOG.md https://github.com/rails/rails/compare/v7.0.2.4...v7.0.3

Example Failed Build: https://github.com/collectiveidea/delayed_job/runs/6060478224?check_suite_focus=true Related https://github.com/open-telemetry/opentelemetry-ruby/issues/1234

Breadcrumbs:

It seems to be included explicitly in when it is used:

https://cs.github.com/rails/rails?q=core_ext%2Fkernel https://cs.github.com/rails/rails?q=kernel%2Freporting https://github.com/rails/rails/blob/8ace32c4ccdc760d17548de777b08c13bc9e07bd/railties/lib/rails.rb#L8

JuanKman94 commented 2 years ago

Ran into this issue while trying to install stringer-rss/stringer.

EDIT: tracked the cause in stringer being dependabot updating ActiveSupport to 7.0.3

willnet commented 2 years ago

Using GitHub Actions on my repository, I ran tests with Rails 7.0.2 and 7.0.3. The 7.0.3 test now passes with the patch. LGTM!