You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because thread_mattr_accessor uses Thread.current[], doing self.prevent_instance_data_manipulation_after_freezing = false in the Object extension doesn't work when using fibers (it defaults to true). FWIW discussions in rails/rails#19693 seem related.
In our case we set config.active_support.isolation_level = :fiber in the Rails config.
For instance:
/usr/local/bundle/gems/console1984-0.1.31/lib/console1984/freezeable.rb:42:in `block in prevent_sensitive_method': You can't invoke instance_variable_get on #<ActiveRecord::Reflection::RuntimeReflection:0x00007fb3f5340700> (Console1984::Errors::ForbiddenCommandAttempted)
from /usr/local/bundle/bundler/gems/activerecord-jsonb-associations-dde23b72bdb7/lib/activerecord/jsonb/associations/association_scope.rb:7:in `last_chain_scope'
from /usr/local/bundle/gems/activerecord-7.1.3/lib/active_record/associations/association_scope.rb:125:in `add_constraints'
from /usr/local/bundle/gems/activerecord-7.1.3/lib/active_record/associations/association_scope.rb:29:in `scope'
Any reason to use thread_mattr_accessor in this case versus mattr_accessor?
The text was updated successfully, but these errors were encountered:
Because
thread_mattr_accessor
usesThread.current[]
, doingself.prevent_instance_data_manipulation_after_freezing = false
in theObject
extension doesn't work when using fibers (it defaults totrue
). FWIW discussions in rails/rails#19693 seem related.In our case we set
config.active_support.isolation_level = :fiber
in the Rails config.For instance:
Any reason to use
thread_mattr_accessor
in this case versusmattr_accessor
?The text was updated successfully, but these errors were encountered: