-
-
Notifications
You must be signed in to change notification settings - Fork 118
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
Uninitialized constant for nested class in sidekiq after code reload with Rails 7 and bootsnap #198
Comments
First, let me congratulate you on this extremely good bug report. Terrific. I have been able to reproduce and the behavior is puzzling, I'll dig into it. |
If I disable @casperisfine do you know what could be happening? As a refresher, implicit namespaces like |
@casperisfine In case it helps, I saw that when the error happens, Zeitwerk's |
I have tried with Rails 6.1 + Zeitwerk 2.4/2.5 + Bootsnap 1.9.3 (the same version used in the original demo), and cannot reproduce. Going to bisect Rails 7. |
I am now running the application in the host. Have selectively disabled Bootsnap caches:
and the only one that matters is |
And I have verified that, when reproducing the problem, Bootsnap::LoadPathCache.loaded_features_index.key?(path) returns |
I have the key difference: In Rails < 7, Zeitwerk's However, in the Sidekiq process in the demo, Bootsnap I'll leave it here today, but we have it. |
After sleeping on it, the conclusion is that Zeitwerk and Bootsnap are not fully compatible as they are today, because if you load Zeitwerk wrapper first, and Bootsnap's wrapper later, reloading of implicit namespaces won't work. Remember, Zeitwerk could be used by any gem dependency of the application, as early as you want, or we could be in a project that is not Rails. I'll see why is the order different when we launch Sidekiq in a Rails 7 application (the server reloads fine), but regardless, this issue has uncovered a conflict I was not aware of. Not sure what's the right way to approach it in the general case. On one hand, Zeitwerk is intercepting the implicit directories it manages and does not pass them up to the original I can imagine practical solutions to this, but the question is which is the good one conceptually. |
Ack. I'll try to look at this in a couple days. |
I have considered different approaches:
EDIT: I implemented (4) below. My preferred solution is (5), and I have implemented it in this branch. @Earlopain Would it be possible to test your real application with it? git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem "zeitwerk", github: "fxn/zeitwerk", branch: "loaded-features" |
First of, thank you for investigating this issue the way you did, I really appreciate it. I added the snippet you provided to my |
@Earlopain You're right, I did a mistake when trying here and the patch is wrong. |
@Earlopain I should have deleted the directories from a I have implemented (4) in the same branch, could you please try again? You'll need to |
I will give the revised fix a try tomorrow. |
I can confirm that using the branch as it currently is fixes the issue in both the demo and my real application. |
@Earlopain I have published 2.5.2 with this change. Thanks again for your awesome bug report. @casperisfine I believe you can mostly skip the thread. Summary is: Zeitwerk's So, in 2.5.2 Zeitwerk's The trade-off is that now we have directories in |
@fxn thanks for the summary, I must admit I was a bit lazy to dig into this during my vacations :) Directories in |
@byroot enjoy your holidays man :). |
I have reverted that patch and published 2.5.3, because the performance impact was too much. In CRuby < 3.1 the impact was noticeable, but In CRuby 3.1 it was dramatic: implicit namespaces were about 180x slower because direct modifications of This follows the advice of @jeremyevans, who also believes Bootsnap is responsible for having a cache that is in sync with the cached collection, and that Zeitwerk's original behavior seems more reasonable than Bootsnap assumptions. |
I have opened Shopify/bootsnap#383. Meanwhile, anyone facing this can disable the load path cache in # config/boot.rb
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
require "bundler/setup" # Set up gems listed in the Gemfile.
ENV['DISABLE_BOOTSNAP_LOAD_PATH_CACHE'] = '1' # <---------- ADD THIS LINE
require "bootsnap/setup" # Speed up boot time by caching expensive operations. |
While the truly root issue we need to address is that Bootsnap and Zeitwerk should ideally be able to be loaded in any order, I have nonetheless investigated why is the order different in Rails 7. Rails 6.x had to be ready to boot in two different autoloading modes, and the integration was written to carefully leave everything as it was in Rails 5 if running in require "rails" by itself did not load Zeitwerk. In Rails 7, all this has been greatly simplified internally because there is only one autoloading mode, and Now, the So, that's only for understanding. This load order should not matter if we can make the libraries fully-compatible in this aspect. |
While the edge case with Bootsnap is addressed at its root, I have delayed loading Zeitwerk in Rails just enough to make this loading order be a non-issue in Rails apps, it will ship with 7.0.1. Now I do feel we can close this issue. |
Thanks again, I appreciate it |
Fix: #383 Ref: fxn/zeitwerk#198 The loaded feature index goal is to prevent requiring the same "feature" twice if the `$LOAD_PATH` was mutated. e.g: ```ruby require "bundler" # ~/gems/bundler/lib/bundler.rb $LOAD_PATH.unshift("some/path") require "bundler" # some/path/bundler.rb ``` In such scenario Ruby remember that you require "bundler" already and even though it now maps to a new path, it won't load it again. This was causing issues with Zeitwerk if it is loaded before bootsnap (see refs), because the cache wouldn't be cleared. But ultimately Zeitwerk always require absolute paths, and the concern described above simply doesn't apply to absolute paths. So we can simply bail out early in these cases. That fixes the bug, and also means less work and a smaller index, so win-win.
Fix: #383 Ref: fxn/zeitwerk#198 The loaded feature index goal is to prevent requiring the same "feature" twice if the `$LOAD_PATH` was mutated. e.g: ```ruby require "bundler" # ~/gems/bundler/lib/bundler.rb $LOAD_PATH.unshift("some/path") require "bundler" # some/path/bundler.rb ``` In such scenario Ruby remember that you require "bundler" already and even though it now maps to a new path, it won't load it again. This was causing issues with Zeitwerk if it is loaded before bootsnap (see refs), because the cache wouldn't be cleared. But ultimately Zeitwerk always require absolute paths, and the concern described above simply doesn't apply to absolute paths. So we can simply bail out early in these cases. That fixes the bug, and also means less work and a smaller index, so win-win.
Fix: #383 Ref: fxn/zeitwerk#198 The loaded feature index goal is to prevent requiring the same "feature" twice if the `$LOAD_PATH` was mutated. e.g: ```ruby require "bundler" # ~/gems/bundler/lib/bundler.rb $LOAD_PATH.unshift("some/path") require "bundler" # some/path/bundler.rb ``` In such scenario Ruby remember that you require "bundler" already and even though it now maps to a new path, it won't load it again. This was causing issues with Zeitwerk if it is loaded before bootsnap (see refs), because the cache wouldn't be cleared. But ultimately Zeitwerk always require absolute paths, and the concern described above simply doesn't apply to absolute paths. So we can simply bail out early in these cases. That fixes the bug, and also means less work and a smaller index, so win-win.
I opened a PR to fix this, if you feel like trying it: Shopify/bootsnap#385 |
Fix: #383 Ref: fxn/zeitwerk#198 The loaded feature index goal is to prevent requiring the same "feature" twice if the `$LOAD_PATH` was mutated. e.g: ```ruby require "bundler" # ~/gems/bundler/lib/bundler.rb $LOAD_PATH.unshift("some/path") require "bundler" # some/path/bundler.rb ``` In such scenario Ruby remember that you require "bundler" already and even though it now maps to a new path, it won't load it again. This was causing issues with Zeitwerk if it is loaded before bootsnap (see refs), because the cache wouldn't be cleared. But ultimately Zeitwerk always require absolute paths, and the concern described above simply doesn't apply to absolute paths. So we can simply bail out early in these cases. That fixes the bug, and also means less work and a smaller index, so win-win.
Fix: #383 Ref: fxn/zeitwerk#198 The loaded feature index goal is to prevent requiring the same "feature" twice if the `$LOAD_PATH` was mutated. e.g: ```ruby require "bundler" # ~/gems/bundler/lib/bundler.rb $LOAD_PATH.unshift("some/path") require "bundler" # some/path/bundler.rb ``` In such scenario Ruby remember that you require "bundler" already and even though it now maps to a new path, it won't load it again. This was causing issues with Zeitwerk if it is loaded before bootsnap (see refs), because the cache wouldn't be cleared. But ultimately Zeitwerk always require absolute paths, and the concern described above simply doesn't apply to absolute paths. So we can simply bail out early in these cases. That fixes the bug, and also means less work and a smaller index, so win-win.
Fix: #383 Ref: fxn/zeitwerk#198 The loaded feature index goal is to prevent requiring the same "feature" twice if the `$LOAD_PATH` was mutated. e.g: ```ruby require "bundler" # ~/gems/bundler/lib/bundler.rb $LOAD_PATH.unshift("some/path") require "bundler" # some/path/bundler.rb ``` In such scenario Ruby remember that you require "bundler" already and even though it now maps to a new path, it won't load it again. This was causing issues with Zeitwerk if it is loaded before bootsnap (see refs), because the cache wouldn't be cleared. But ultimately Zeitwerk always require absolute paths, and the concern described above simply doesn't apply to absolute paths. So we can simply bail out early in these cases. That fixes the bug, and also means less work and a smaller index, so win-win.
* Prevent duplicate entries in plugin Gemfile. Jonathan Hefner * Fix asset pipeline errors for plugin dummy apps. Jonathan Hefner * Fix generated route revocation. Jonathan Hefner * Addresses an issue in which Sidekiq jobs could not reload certain namespaces. See fxn/zeitwerk#198 for details. Xavier Noria * Fix plugin generator to a plugin that pass all the tests. Rafael Mendonça França
www/ruby-rails70: security fix Revisions pulled up: - databases/ruby-activerecord70/distinfo 1.2-1.3 - devel/ruby-activejob70/distinfo 1.2-1.3 - devel/ruby-activemodel70/distinfo 1.2-1.3 - devel/ruby-activestorage70/PLIST 1.2 - devel/ruby-activestorage70/distinfo 1.2-1.3 - devel/ruby-activesupport70/distinfo 1.2-1.3 - devel/ruby-railties70/distinfo 1.2-1.3 - lang/ruby/rails.mk 1.110,1.114 - mail/ruby-actionmailbox70/distinfo 1.2-1.3 - mail/ruby-actionmailer70/distinfo 1.2-1.3 - textproc/ruby-actiontext70/distinfo 1.2-1.3 - www/ruby-actioncable70/distinfo 1.2-1.3 - www/ruby-actionpack70/distinfo 1.2-1.3 - www/ruby-actionview70/distinfo 1.2-1.3 - www/ruby-rails70/distinfo 1.2-1.3 --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:02:54 UTC 2022 Modified Files: pkgsrc/lang/ruby: rails.mk Log Message: lang/ruby: start update of Ruby on Rails 7.0.1 --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:05:14 UTC 2022 Modified Files: pkgsrc/devel/ruby-activesupport70: distinfo Log Message: devel/ruby-activesupport70: update to 7.0.1 7.0.1 (2021-01-06) * Fix Class#descendants and DescendantsTracker#descendants compatibilit= y with Ruby 3.1. The native Class#descendants was reverted prior to Ruby 3.1 release, = but Class#subclasses was kept, breaking the feature detection. Jean Boussier --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:05:44 UTC 2022 Modified Files: pkgsrc/devel/ruby-activemodel70: distinfo Log Message: devel/ruby-activemodel70: update to 7.0.1 7.0.1 (2021-01-06) * No change. --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:06:14 UTC 2022 Modified Files: pkgsrc/devel/ruby-activejob70: distinfo Log Message: devel/ruby-activejob70: update to 7.0.1 7.0.1 (2021-01-06) * Allow testing discard_on/retry_on ActiveJob::DeserializationError Previously in perform_enqueued_jobs, deserialize_arguments_if_needed was called before calling perform_now. When a record no longer exists and is serialized using GlobalID this led to raising an ActiveJob::DeserializationError before reaching perform_now call. This behaviour makes difficult testing the job discard_on/retry_on logic. Now deserialize_arguments_if_needed call is postponed to when perform_now is called. Example: class UpdateUserJob < ActiveJob::Base discard_on ActiveJob::DeserializationError def perform(user) # ... end end # In the test User.destroy_all assert_nothing_raised do perform_enqueued_jobs only: UpdateUserJob end Jacopo Beschi --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:06:39 UTC 2022 Modified Files: pkgsrc/www/ruby-actionview70: distinfo Log Message: devel/ruby-actionview70: update to 7.0.1 7.0.1 (2021-01-06) * Fix button_to to work with a hash parameter as URL. MingyuanQin * Fix link_to with a model passed as an argument twice. Alex Ghiculescu --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:07:02 UTC 2022 Modified Files: pkgsrc/www/ruby-actionpack70: distinfo Log Message: devel/ruby-actionpack70: update to 7.0.1 7.0.1 (2021-01-06) * Fix ActionController::Parameters methods to keep the original logger context when creating a new copy of the original object. Yutaka Kamei --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:07:29 UTC 2022 Modified Files: pkgsrc/databases/ruby-activerecord70: distinfo Log Message: databases/ruby-activerecord70: update to 7.0.1 7.0.1 (2021-01-06) * Change QueryMethods#in_order_of to drop records not listed in values.= in_order_of now filters down to the values provided, to match the behavior of the Enumerable version. Kevin Newton * Allow named expression indexes to be revertible. Previously, the following code would raise an error in a reversible migration executed while rolling back, due to the index name not being used in the index removal. add_index(:settings, "(data->'property')", using: :gin, name: :index_s= ettings_data_property) Fixes #43331. Oliver G=FCnther * Better error messages when association name is invalid in the argument of ActiveRecord::QueryMethods::WhereChain#missing. ykpythemind * Fix ordered migrations for single db in multi db environment. Himanshu * Extract on update CURRENT_TIMESTAMP for mysql2 adapter. Kazuhiro Masuda * Fix incorrect argument in PostgreSQL structure dump tasks. Updating the --no-comment argument added in Rails 7 to the correct --no-comments argument. Alex Dent * Fix schema dumping column default SQL values for sqlite3. fatkodima * Correctly parse complex check constraint expressions for PostgreSQL. fatkodima * Fix timestamptz attributes on PostgreSQL handle blank inputs. Alex Ghiculescu Fix migration compatibility to create SQLite references/belongs_to column as integer when migration version is 6.0. Reference/belongs_to in migrations with version 6.0 were creating columns as bigint instead of integer for the SQLite Adapter. Marcelo Lauxen * Fix joining through a polymorphic association. Alexandre Ruban * Fix QueryMethods#in_order_of to handle empty order list. Post.in_order_of(:id, []).to_a Also more explicitly set the column as secondary order, so that any other value is still ordered. Jean Boussier * Fix rails dbconsole for 3-tier config. Eileen M. Uchitelle * Fix quoting of column aliases generated by calculation methods. Since the alias is derived from the table name, we can't assume the result is a valid identifier. class Test < ActiveRecord::Base self.table_name =3D '1abc' end Test.group(:id).count # syntax error at or near "1" (ActiveRecord::StatementInvalid) # LINE 1: SELECT COUNT(*) AS count_all, "1abc"."id" AS 1abc_id FROM "1= ... Jean Boussier --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:07:49 UTC 2022 Modified Files: pkgsrc/devel/ruby-activestorage70: distinfo Log Message: devel/ruby-activestorage70: update to 7.0.1 7.0.1 (2021-01-06) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:08:13 UTC 2022 Modified Files: pkgsrc/mail/ruby-actionmailer70: distinfo Log Message: mail/ruby-actionmailer70: update to 7.0.1 * Keep configuration of smtp_settings consistent between 6.1 and 7.0. Andr=E9 Luis Leal Cardoso Junior --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:08:57 UTC 2022 Modified Files: pkgsrc/mail/ruby-actionmailbox70: distinfo Log Message: mail/ruby-actionmailbox70: update to 7.0.1 7.0.1 (2021-01-06) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:09:16 UTC 2022 Modified Files: pkgsrc/www/ruby-actioncable70: distinfo Log Message: www/ruby-actioncable70: update to 7.0.1 7.0.1 (2021-01-06) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:10:09 UTC 2022 Modified Files: pkgsrc/devel/ruby-railties70: distinfo Log Message: devel/ruby-railties70: 7.0.1 (2021-01-06) * Prevent duplicate entries in plugin Gemfile. Jonathan Hefner * Fix asset pipeline errors for plugin dummy apps. Jonathan Hefner * Fix generated route revocation. Jonathan Hefner * Addresses an issue in which Sidekiq jobs could not reload certain namespaces. See fxn/zeitwerk#198 for details. Xavier Noria * Fix plugin generator to a plugin that pass all the tests. Rafael Mendon=E7a Fran=E7a --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:10:40 UTC 2022 Modified Files: pkgsrc/textproc/ruby-actiontext70: distinfo Log Message: textproc/ruby-actiontext70: 7.0.1 (2021-01-06) 7.0.1 (2021-01-06) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:12:56 UTC 2022 Modified Files: pkgsrc/www/ruby-rails70: distinfo Log Message: www/ruby-rails70: update to 7.0.1 This is meta gem (package) for Ruby on Rails 7.0.1. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:39:14 UTC 2022 Modified Files: pkgsrc/lang/ruby: rails.mk Log Message: lang/ruby: start update of ruby-rails70 to 7.0.2.2 --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:41:06 UTC 2022 Modified Files: pkgsrc/devel/ruby-activesupport70: distinfo Log Message: devel/ruby-activesupport70: update to 7.0.2 7.0.2 (2022-02-08) * Fix ActiveSupport::EncryptedConfiguration to be compatible with Psych= 4 Stephen Sugden * Improve File.atomic_write error handling. Daniel Pepper 7.0.2.1 (2022-02-11) * No changes. 7.0.2.2 (2022-02-11) * Fix Reloader method signature to work with the new Executor signature= --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:41:59 UTC 2022 Modified Files: pkgsrc/devel/ruby-activemodel70: distinfo Log Message: devel/ruby-activemodel70: update to 7.0.2 7.0.2 (2022-02-08) * Use different cache namespace for proxy calls Models can currently have different attribute bodies for the same met= hod names, leading to conflicts. Adding a new namespace :active_model_pro= xy fixes the issue. Chris Salzberg 7.0.2.1 (2022-02-11) * No changes. 7.0.2.2 (2022-02-11) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:42:23 UTC 2022 Modified Files: pkgsrc/devel/ruby-activejob70: distinfo Log Message: devel/ruby-activejob70: update to 7.0.2 7.0.2 (2022-02-08) * No changes. 7.0.2.1 (2022-02-11) * No changes. 7.0.2.2 (2022-02-11) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:42:47 UTC 2022 Modified Files: pkgsrc/www/ruby-actionview70: distinfo Log Message: www/ruby-actionview70: update to 7.0.2 7.0.2 (2022-02-08) * Ensure preload_link_tag preloads JavaScript modules correctly. M=E1ximo Mussini * Fix stylesheet_link_tag and similar helpers are being used to work in= objects with a response method. dark-panda 7.0.2.1 (2022-02-11) * No changes. 7.0.2.2 (2022-02-11) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:43:27 UTC 2022 Modified Files: pkgsrc/www/ruby-actionpack70: distinfo Log Message: www/ruby-actionpack70: update to 7.0.2 This update contains security fix for CVE-2022-23633. 7.0.2 (2022-02-08) * No changes. 7.0.2.1 (2022-02-11) * Under certain circumstances, the middleware isn't informed that the response body has been fully closed which result in request state not being fully reset before the next request [CVE-2022-23633] 7.0.2.2 (2022-02-11) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:43:55 UTC 2022 Modified Files: pkgsrc/databases/ruby-activerecord70: distinfo Log Message: databases/ruby-activerecord70: update to 7.0.2 7.0.2 (2022-02-08) * Fix PG.connect keyword arguments deprecation warning on ruby 2.7. Nikita Vasilevsky * Fix the ability to exclude encryption params from being autofiltered.= Mark Gangl * Dump the precision for datetime columns following the new defaults. Rafael Mendon=E7a Fran=E7a * Make sure encrypted attributes are not being filtered twice. Nikita Vasilevsky * Dump the database schema containing the current Rails version. Since #42297, Rails now generate datetime columns with a default prec= ision of 6. This means that users upgrading to Rails 7.0 from 6.1, when lo= ading the database schema, would get the new precision value, which would n= ot match the production schema. To avoid this the schema dumper will generate the new format which wi= ll include the Rails version and will look like this: ActiveRecord::Schema[7.0].define When upgrading from Rails 6.1 to Rails 7.0, you can run the rails app:update task that will set the current schema version to 6.1. Rafael Mendon=E7a Fran=E7a * Fix parsing expression for PostgreSQL generated column. fatkodima * Fix Mysql2::Error: Commands out of sync; you can't run this command n= ow when bulk-inserting fixtures that exceed max_allowed_packet configura= tion. Nikita Vasilevsky * Fix error when saving an association with a relation named record. Dorian Mari=E9 * Fix MySQL::SchemaDumper behavior about datetime precision value. y0t4 * Improve associated with no reflection error. Nikolai * Fix PG.connect keyword arguments deprecation warning on ruby 2.7. Fixes #44307. Nikita Vasilevsky * Fix passing options to check_constraint from change_table. Frederick Cheung 7.0.2.1 (2022-02-11) * No changes. 7.0.2.2 (2022-02-11) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:44:29 UTC 2022 Modified Files: pkgsrc/devel/ruby-activestorage70: PLIST distinfo Log Message: devel/ruby-activestorage70: update to 7.0.2 7.0.2 (2022-02-08) * Revert the ability to pass service_name param to DirectUploadsControl= ler which was introduced in 7.0.0. That change caused a lot of problems to upgrade Rails applications so= we decided to remove it while in work in a more backwards compatible implementation. Gannon McGibbon * Allow applications to opt out of precompiling Active Storage JavaScri= pt assets. jlestavel 7.0.2.1 (2022-02-11) * No changes. 7.0.2.2 (2022-02-11) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:44:47 UTC 2022 Modified Files: pkgsrc/mail/ruby-actionmailer70: distinfo Log Message: mail/ruby-actionmailer70: update to 7.0.2 7.0.2 (2022-02-08) * No changes. 7.0.2.1 (2022-02-11) * No changes. 7.0.2.2 (2022-02-11) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:45:05 UTC 2022 Modified Files: pkgsrc/mail/ruby-actionmailbox70: distinfo Log Message: mail/ruby-actionmailbox70: update to 7.0.2 7.0.2 (2022-02-08) * No changes. 7.0.2.1 (2022-02-11) * No changes. 7.0.2.2 (2022-02-11) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:45:27 UTC 2022 Modified Files: pkgsrc/www/ruby-actioncable70: distinfo Log Message: www/ruby-actioncable70: update to 7.0.2 7.0.2 (2022-02-08) * No changes. 7.0.2.1 (2022-02-11) * No changes. 7.0.2.2 (2022-02-11) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:45:49 UTC 2022 Modified Files: pkgsrc/devel/ruby-railties70: distinfo Log Message: devel/ruby-railties70: update to 7.0.2 7.0.2 (2022-02-08) * No changes. 7.0.2.1 (2022-02-11) * No changes. 7.0.2.2 (2022-02-11) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:46:12 UTC 2022 Modified Files: pkgsrc/textproc/ruby-actiontext70: distinfo Log Message: textproc/ruby-actiontext70: update to 7.0.2 7.0.2 (2022-02-08) * No changes. 7.0.2.1 (2022-02-11) * No changes. 7.0.2.2 (2022-02-11) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:47:25 UTC 2022 Modified Files: pkgsrc/www/ruby-rails70: distinfo Log Message: www/ruby-rails70: update to 7.0.2 This gem is a meta package for Ruby on Rails 7, so no changes here.
www/ruby-rails70: security fix Revisions pulled up: - databases/ruby-activerecord70/distinfo 1.2-1.3 - devel/ruby-activejob70/distinfo 1.2-1.3 - devel/ruby-activemodel70/distinfo 1.2-1.3 - devel/ruby-activestorage70/PLIST 1.2 - devel/ruby-activestorage70/distinfo 1.2-1.3 - devel/ruby-activesupport70/distinfo 1.2-1.3 - devel/ruby-railties70/distinfo 1.2-1.3 - lang/ruby/rails.mk 1.110,1.114 - mail/ruby-actionmailbox70/distinfo 1.2-1.3 - mail/ruby-actionmailer70/distinfo 1.2-1.3 - textproc/ruby-actiontext70/distinfo 1.2-1.3 - www/ruby-actioncable70/distinfo 1.2-1.3 - www/ruby-actionpack70/distinfo 1.2-1.3 - www/ruby-actionview70/distinfo 1.2-1.3 - www/ruby-rails70/distinfo 1.2-1.3 --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:02:54 UTC 2022 Modified Files: pkgsrc/lang/ruby: rails.mk Log Message: lang/ruby: start update of Ruby on Rails 7.0.1 --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:05:14 UTC 2022 Modified Files: pkgsrc/devel/ruby-activesupport70: distinfo Log Message: devel/ruby-activesupport70: update to 7.0.1 7.0.1 (2021-01-06) * Fix Class#descendants and DescendantsTracker#descendants compatibilit= y with Ruby 3.1. The native Class#descendants was reverted prior to Ruby 3.1 release, = but Class#subclasses was kept, breaking the feature detection. Jean Boussier --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:05:44 UTC 2022 Modified Files: pkgsrc/devel/ruby-activemodel70: distinfo Log Message: devel/ruby-activemodel70: update to 7.0.1 7.0.1 (2021-01-06) * No change. --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:06:14 UTC 2022 Modified Files: pkgsrc/devel/ruby-activejob70: distinfo Log Message: devel/ruby-activejob70: update to 7.0.1 7.0.1 (2021-01-06) * Allow testing discard_on/retry_on ActiveJob::DeserializationError Previously in perform_enqueued_jobs, deserialize_arguments_if_needed was called before calling perform_now. When a record no longer exists and is serialized using GlobalID this led to raising an ActiveJob::DeserializationError before reaching perform_now call. This behaviour makes difficult testing the job discard_on/retry_on logic. Now deserialize_arguments_if_needed call is postponed to when perform_now is called. Example: class UpdateUserJob < ActiveJob::Base discard_on ActiveJob::DeserializationError def perform(user) # ... end end # In the test User.destroy_all assert_nothing_raised do perform_enqueued_jobs only: UpdateUserJob end Jacopo Beschi --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:06:39 UTC 2022 Modified Files: pkgsrc/www/ruby-actionview70: distinfo Log Message: devel/ruby-actionview70: update to 7.0.1 7.0.1 (2021-01-06) * Fix button_to to work with a hash parameter as URL. MingyuanQin * Fix link_to with a model passed as an argument twice. Alex Ghiculescu --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:07:02 UTC 2022 Modified Files: pkgsrc/www/ruby-actionpack70: distinfo Log Message: devel/ruby-actionpack70: update to 7.0.1 7.0.1 (2021-01-06) * Fix ActionController::Parameters methods to keep the original logger context when creating a new copy of the original object. Yutaka Kamei --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:07:29 UTC 2022 Modified Files: pkgsrc/databases/ruby-activerecord70: distinfo Log Message: databases/ruby-activerecord70: update to 7.0.1 7.0.1 (2021-01-06) * Change QueryMethods#in_order_of to drop records not listed in values.= in_order_of now filters down to the values provided, to match the behavior of the Enumerable version. Kevin Newton * Allow named expression indexes to be revertible. Previously, the following code would raise an error in a reversible migration executed while rolling back, due to the index name not being used in the index removal. add_index(:settings, "(data->'property')", using: :gin, name: :index_s= ettings_data_property) Fixes #43331. Oliver G=FCnther * Better error messages when association name is invalid in the argument of ActiveRecord::QueryMethods::WhereChain#missing. ykpythemind * Fix ordered migrations for single db in multi db environment. Himanshu * Extract on update CURRENT_TIMESTAMP for mysql2 adapter. Kazuhiro Masuda * Fix incorrect argument in PostgreSQL structure dump tasks. Updating the --no-comment argument added in Rails 7 to the correct --no-comments argument. Alex Dent * Fix schema dumping column default SQL values for sqlite3. fatkodima * Correctly parse complex check constraint expressions for PostgreSQL. fatkodima * Fix timestamptz attributes on PostgreSQL handle blank inputs. Alex Ghiculescu Fix migration compatibility to create SQLite references/belongs_to column as integer when migration version is 6.0. Reference/belongs_to in migrations with version 6.0 were creating columns as bigint instead of integer for the SQLite Adapter. Marcelo Lauxen * Fix joining through a polymorphic association. Alexandre Ruban * Fix QueryMethods#in_order_of to handle empty order list. Post.in_order_of(:id, []).to_a Also more explicitly set the column as secondary order, so that any other value is still ordered. Jean Boussier * Fix rails dbconsole for 3-tier config. Eileen M. Uchitelle * Fix quoting of column aliases generated by calculation methods. Since the alias is derived from the table name, we can't assume the result is a valid identifier. class Test < ActiveRecord::Base self.table_name =3D '1abc' end Test.group(:id).count # syntax error at or near "1" (ActiveRecord::StatementInvalid) # LINE 1: SELECT COUNT(*) AS count_all, "1abc"."id" AS 1abc_id FROM "1= ... Jean Boussier --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:07:49 UTC 2022 Modified Files: pkgsrc/devel/ruby-activestorage70: distinfo Log Message: devel/ruby-activestorage70: update to 7.0.1 7.0.1 (2021-01-06) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:08:13 UTC 2022 Modified Files: pkgsrc/mail/ruby-actionmailer70: distinfo Log Message: mail/ruby-actionmailer70: update to 7.0.1 * Keep configuration of smtp_settings consistent between 6.1 and 7.0. Andr=E9 Luis Leal Cardoso Junior --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:08:57 UTC 2022 Modified Files: pkgsrc/mail/ruby-actionmailbox70: distinfo Log Message: mail/ruby-actionmailbox70: update to 7.0.1 7.0.1 (2021-01-06) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:09:16 UTC 2022 Modified Files: pkgsrc/www/ruby-actioncable70: distinfo Log Message: www/ruby-actioncable70: update to 7.0.1 7.0.1 (2021-01-06) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:10:09 UTC 2022 Modified Files: pkgsrc/devel/ruby-railties70: distinfo Log Message: devel/ruby-railties70: 7.0.1 (2021-01-06) * Prevent duplicate entries in plugin Gemfile. Jonathan Hefner * Fix asset pipeline errors for plugin dummy apps. Jonathan Hefner * Fix generated route revocation. Jonathan Hefner * Addresses an issue in which Sidekiq jobs could not reload certain namespaces. See fxn/zeitwerk#198 for details. Xavier Noria * Fix plugin generator to a plugin that pass all the tests. Rafael Mendon=E7a Fran=E7a --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:10:40 UTC 2022 Modified Files: pkgsrc/textproc/ruby-actiontext70: distinfo Log Message: textproc/ruby-actiontext70: 7.0.1 (2021-01-06) 7.0.1 (2021-01-06) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Jan 16 14:12:56 UTC 2022 Modified Files: pkgsrc/www/ruby-rails70: distinfo Log Message: www/ruby-rails70: update to 7.0.1 This is meta gem (package) for Ruby on Rails 7.0.1. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:39:14 UTC 2022 Modified Files: pkgsrc/lang/ruby: rails.mk Log Message: lang/ruby: start update of ruby-rails70 to 7.0.2.2 --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:41:06 UTC 2022 Modified Files: pkgsrc/devel/ruby-activesupport70: distinfo Log Message: devel/ruby-activesupport70: update to 7.0.2 7.0.2 (2022-02-08) * Fix ActiveSupport::EncryptedConfiguration to be compatible with Psych= 4 Stephen Sugden * Improve File.atomic_write error handling. Daniel Pepper 7.0.2.1 (2022-02-11) * No changes. 7.0.2.2 (2022-02-11) * Fix Reloader method signature to work with the new Executor signature= --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:41:59 UTC 2022 Modified Files: pkgsrc/devel/ruby-activemodel70: distinfo Log Message: devel/ruby-activemodel70: update to 7.0.2 7.0.2 (2022-02-08) * Use different cache namespace for proxy calls Models can currently have different attribute bodies for the same met= hod names, leading to conflicts. Adding a new namespace :active_model_pro= xy fixes the issue. Chris Salzberg 7.0.2.1 (2022-02-11) * No changes. 7.0.2.2 (2022-02-11) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:42:23 UTC 2022 Modified Files: pkgsrc/devel/ruby-activejob70: distinfo Log Message: devel/ruby-activejob70: update to 7.0.2 7.0.2 (2022-02-08) * No changes. 7.0.2.1 (2022-02-11) * No changes. 7.0.2.2 (2022-02-11) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:42:47 UTC 2022 Modified Files: pkgsrc/www/ruby-actionview70: distinfo Log Message: www/ruby-actionview70: update to 7.0.2 7.0.2 (2022-02-08) * Ensure preload_link_tag preloads JavaScript modules correctly. M=E1ximo Mussini * Fix stylesheet_link_tag and similar helpers are being used to work in= objects with a response method. dark-panda 7.0.2.1 (2022-02-11) * No changes. 7.0.2.2 (2022-02-11) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:43:27 UTC 2022 Modified Files: pkgsrc/www/ruby-actionpack70: distinfo Log Message: www/ruby-actionpack70: update to 7.0.2 This update contains security fix for CVE-2022-23633. 7.0.2 (2022-02-08) * No changes. 7.0.2.1 (2022-02-11) * Under certain circumstances, the middleware isn't informed that the response body has been fully closed which result in request state not being fully reset before the next request [CVE-2022-23633] 7.0.2.2 (2022-02-11) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:43:55 UTC 2022 Modified Files: pkgsrc/databases/ruby-activerecord70: distinfo Log Message: databases/ruby-activerecord70: update to 7.0.2 7.0.2 (2022-02-08) * Fix PG.connect keyword arguments deprecation warning on ruby 2.7. Nikita Vasilevsky * Fix the ability to exclude encryption params from being autofiltered.= Mark Gangl * Dump the precision for datetime columns following the new defaults. Rafael Mendon=E7a Fran=E7a * Make sure encrypted attributes are not being filtered twice. Nikita Vasilevsky * Dump the database schema containing the current Rails version. Since #42297, Rails now generate datetime columns with a default prec= ision of 6. This means that users upgrading to Rails 7.0 from 6.1, when lo= ading the database schema, would get the new precision value, which would n= ot match the production schema. To avoid this the schema dumper will generate the new format which wi= ll include the Rails version and will look like this: ActiveRecord::Schema[7.0].define When upgrading from Rails 6.1 to Rails 7.0, you can run the rails app:update task that will set the current schema version to 6.1. Rafael Mendon=E7a Fran=E7a * Fix parsing expression for PostgreSQL generated column. fatkodima * Fix Mysql2::Error: Commands out of sync; you can't run this command n= ow when bulk-inserting fixtures that exceed max_allowed_packet configura= tion. Nikita Vasilevsky * Fix error when saving an association with a relation named record. Dorian Mari=E9 * Fix MySQL::SchemaDumper behavior about datetime precision value. y0t4 * Improve associated with no reflection error. Nikolai * Fix PG.connect keyword arguments deprecation warning on ruby 2.7. Fixes #44307. Nikita Vasilevsky * Fix passing options to check_constraint from change_table. Frederick Cheung 7.0.2.1 (2022-02-11) * No changes. 7.0.2.2 (2022-02-11) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:44:29 UTC 2022 Modified Files: pkgsrc/devel/ruby-activestorage70: PLIST distinfo Log Message: devel/ruby-activestorage70: update to 7.0.2 7.0.2 (2022-02-08) * Revert the ability to pass service_name param to DirectUploadsControl= ler which was introduced in 7.0.0. That change caused a lot of problems to upgrade Rails applications so= we decided to remove it while in work in a more backwards compatible implementation. Gannon McGibbon * Allow applications to opt out of precompiling Active Storage JavaScri= pt assets. jlestavel 7.0.2.1 (2022-02-11) * No changes. 7.0.2.2 (2022-02-11) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:44:47 UTC 2022 Modified Files: pkgsrc/mail/ruby-actionmailer70: distinfo Log Message: mail/ruby-actionmailer70: update to 7.0.2 7.0.2 (2022-02-08) * No changes. 7.0.2.1 (2022-02-11) * No changes. 7.0.2.2 (2022-02-11) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:45:05 UTC 2022 Modified Files: pkgsrc/mail/ruby-actionmailbox70: distinfo Log Message: mail/ruby-actionmailbox70: update to 7.0.2 7.0.2 (2022-02-08) * No changes. 7.0.2.1 (2022-02-11) * No changes. 7.0.2.2 (2022-02-11) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:45:27 UTC 2022 Modified Files: pkgsrc/www/ruby-actioncable70: distinfo Log Message: www/ruby-actioncable70: update to 7.0.2 7.0.2 (2022-02-08) * No changes. 7.0.2.1 (2022-02-11) * No changes. 7.0.2.2 (2022-02-11) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:45:49 UTC 2022 Modified Files: pkgsrc/devel/ruby-railties70: distinfo Log Message: devel/ruby-railties70: update to 7.0.2 7.0.2 (2022-02-08) * No changes. 7.0.2.1 (2022-02-11) * No changes. 7.0.2.2 (2022-02-11) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:46:12 UTC 2022 Modified Files: pkgsrc/textproc/ruby-actiontext70: distinfo Log Message: textproc/ruby-actiontext70: update to 7.0.2 7.0.2 (2022-02-08) * No changes. 7.0.2.1 (2022-02-11) * No changes. 7.0.2.2 (2022-02-11) * No changes. --- Module Name: pkgsrc Committed By: taca Date: Sun Feb 13 07:47:25 UTC 2022 Modified Files: pkgsrc/www/ruby-rails70: distinfo Log Message: www/ruby-rails70: update to 7.0.2 This gem is a meta package for Ruby on Rails 7, so no changes here.
Hi, I run into issues with sidekiq after making changes with code reload. The project is using Rails 7, Ruby 3.0.3 and Zeitwerk 2.5.1
The relevant directory structure is as follows:
a.rb
c.rb
Once the application is started everything works fine, both classes are available to rails and sidekiq with no issues. If the code is autoreloaded by making code changes
B::C
isn't available to sidekiq anymore, while both classes are still accesible by rails. Adding an empty moduleapp/test/b.rb
solves the issue, but I shouldn't have to do that.I'm not sure if this is a problem with zeitwerk, but it looked like a good place to start since it seems to be some kind of loading issue.
Here is a minimal repro, if needed. https://github.com/Earlopain/zeitwerk-repro. It's docker, after starting the application will be available under
localhost:9000
There's one page, which prints out
A
andB::C
. Loading also calls a sidekiq worker, which only logsA
andB::C
. Again, on first load everything works as expected but after code changes sidekiq cannot findB::C
anymore.Here's the log for both rails and sidekiq
After making changes sidekiq unloads
B::C
but does not reload it.The text was updated successfully, but these errors were encountered: