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

ActiveRecord 7.1 with ActiveSupport::Concurrency::NullLock doesn't keep the connection in the thread, PostgreSQLAdapter repeatedly calling load_types_queries #49976

Closed
Amnesthesia opened this issue Nov 8, 2023 · 4 comments

Comments

@Amnesthesia
Copy link

We use multitenancy through a legacy gem that we haven't been able to get rid of yet (Apartment), and after upgrading from Rails 7.0 to 7.1 we noticed massively increased database load coming from a huge amount of slow calls looking like:

            SELECT t.oid, t.typname, t.typelem, t.typdelim, t.typinput, r.rngsubtype, t.typtype, t.typbasetype
            FROM pg_type as t
            LEFT JOIN pg_range as r ON oid = rngtypid

This seems to come from PostgreSQLAdapter#load_types_queries, and to debug this I added:

raise 'LOADING TYPE QUERIES'
rescue => e
  puts "FROM: "
  puts e.backtrace

Just so that it would print out the whole trace of where it was coming from and how it was getting there. It seems like every time the connection is being accessed, calling active? then calls verify!, and for some reason, @raw_connection is always nil now.

Comparing the source from 7.0 to 7.1, it seems to be related to how ActiveRecord::ConnectionAdapters::AbstractAdapter has changed to use ActiveSupport::Concurrency::NullLock, rather than ActiveSupport::Concurrency::LoadInterlockAwareMonitor. Forcibly changing this lock back seems to resolve the issue here, and PostgreSQL#reload_type_map is no longer being called, but this locking isn't configurable anywhere, and will always be set to use NullLock.

Steps to reproduce

Easiest way to get an overview of these queries being run I found was to add an exception, catch it and print the backtrace:

# in lib/active_record/connection_adapters/postgresql_adapter.rb

def load_types_queries(initializer, oids)
    query = <<~SQL
      SELECT t.oid, t.typname, t.typelem, t.typdelim, t.typinput, r.rngsubtype, t.typtype, t.typbasetype
      FROM pg_type as t
      LEFT JOIN pg_range as r ON oid = rngtypid
    SQL
    if oids
      yield query + "WHERE t.oid IN (%s)" % oids.join(", ")
    else
      yield query + initializer.query_conditions_for_known_type_names
      yield query + initializer.query_conditions_for_known_type_types
      yield query + initializer.query_conditions_for_array_types
    end
    raise 'Calling PostgreSQLAdapter#load_types_queries'
  rescue => e
    puts 'Callstack: '
    puts e.backtrace
  end

Expected behavior

If the connection is being reset while still executing inside the same thread, then at least cache the results from the types queries to avoid firing this query again and again. On databases with large amounts of tables and/or schemas, this can be a very expensive query

Actual behavior

Connection is being reset! and reconfigured repeatedly in the same thread, we're seeing this call 3-5 times per request on top of when switching schemas

System configuration

Rails version: 7.1.1

Ruby version: 3.2.2

@Amnesthesia Amnesthesia changed the title Rails 7.1.1 with NullLock doesn't seem to keep the connection in the thread, causing repeated calls to load_types_queries in postgres ActiveRecord 7.1 with ActiveSupport::Concurrency::NullLock doesn't keep the connection in the thread, PostgreSQLAdapter repeatedly calling load_types_queries Nov 8, 2023
@fatkodima
Copy link
Member

Can you paste the full backtrace here? And it would be helpful if you can create a sample reproduction app.

@yahonda yahonda added the more-information-needed When reporter needs to provide more information label Nov 8, 2023
@Amnesthesia
Copy link
Author

Amnesthesia commented Nov 9, 2023

Can you paste the full backtrace here? And it would be helpful if you can create a sample reproduction app.

The full backtrace looks like this:

Callstack:
FROM: 
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:868:in `load_types_queries'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:848:in `load_additional_types'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:730:in `initialize_type_map'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:361:in `block in reload_type_map'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activesupport-7.1.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:354:in `reload_type_map'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:1043:in `configure_connection'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/connection_adapters/abstract_adapter.rb:693:in `block (2 levels) in reconnect!'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:374:in `reset_transaction'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/connection_adapters/abstract_adapter.rb:691:in `block in reconnect!'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activesupport-7.1.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/connection_adapters/abstract_adapter.rb:684:in `reconnect!'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/connection_adapters/abstract_adapter.rb:788:in `verify!'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/connection_adapters/postgresql/quoting.rb:152:in `lookup_cast_type_from_column'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/model_schema.rb:620:in `block in load_schema!'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/model_schema.rb:619:in `each'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/model_schema.rb:619:in `load_schema!'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/attributes.rb:264:in `load_schema!'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/encryption/encryptable_record.rb:127:in `load_schema!'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/model_schema.rb:561:in `block in load_schema'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/model_schema.rb:558:in `synchronize'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/model_schema.rb:558:in `load_schema'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/model_schema.rb:492:in `column_defaults'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/state_machines-activerecord-0.9.0/lib/state_machines/integrations/active_record.rb:439:in `owner_class_attribute_default'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/state_machines-0.6.0/lib/state_machines/machine.rb:603:in `initial_state='
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/state_machines-0.6.0/lib/state_machines/machine.rb:546:in `initialize'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/state_machines-0.6.0/lib/state_machines/machine.rb:439:in `new'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/state_machines-0.6.0/lib/state_machines/machine.rb:439:in `find_or_create'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/state_machines-0.6.0/lib/state_machines/macro_methods.rb:517:in `state_machine'
/Users/amnesthesia/Dev/web/app/models/concerns/stateable/patient_record.rb:6:in `block in <module:PatientRecord>'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activesupport-7.1.1/lib/active_support/concern.rb:138:in `class_eval'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activesupport-7.1.1/lib/active_support/concern.rb:138:in `append_features'
/Users/amnesthesia/Dev/web/app/models/patient_record.rb:36:in `include'
/Users/amnesthesia/Dev/web/app/models/patient_record.rb:36:in `<class:PatientRecord>'
/Users/amnesthesia/Dev/web/app/models/patient_record.rb:34:in `<top (required)>'
<internal:/Users/amnesthesia/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/Users/amnesthesia/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:30:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/Users/amnesthesia/Dev/web/app/graphql/types/patient_record_state_type.rb:3:in `<class:PatientRecordStateType>'
/Users/amnesthesia/Dev/web/app/graphql/types/patient_record_state_type.rb:2:in `<module:Types>'
/Users/amnesthesia/Dev/web/app/graphql/types/patient_record_state_type.rb:1:in `<top (required)>'
<internal:/Users/amnesthesia/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/Users/amnesthesia/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:30:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/Users/amnesthesia/Dev/web/app/graphql/types/patient_record_type.rb:8:in `<class:PatientRecordType>'
/Users/amnesthesia/Dev/web/app/graphql/types/patient_record_type.rb:2:in `<module:Types>'
/Users/amnesthesia/Dev/web/app/graphql/types/patient_record_type.rb:1:in `<top (required)>'
<internal:/Users/amnesthesia/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/Users/amnesthesia/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:30:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/Users/amnesthesia/Dev/web/app/graphql/types/treatments/treatment_type.rb:32:in `<class:TreatmentType>'
/Users/amnesthesia/Dev/web/app/graphql/types/treatments/treatment_type.rb:2:in `<module:Treatments>'
/Users/amnesthesia/Dev/web/app/graphql/types/treatments/treatment_type.rb:1:in `<top (required)>'
<internal:/Users/amnesthesia/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/Users/amnesthesia/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:30:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/Users/amnesthesia/Dev/web/app/graphql/types/user_practice_link_type.rb:50:in `<class:UserPracticeLinkType>'
/Users/amnesthesia/Dev/web/app/graphql/types/user_practice_link_type.rb:2:in `<module:Types>'
/Users/amnesthesia/Dev/web/app/graphql/types/user_practice_link_type.rb:1:in `<top (required)>'
<internal:/Users/amnesthesia/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/Users/amnesthesia/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:30:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/Users/amnesthesia/Dev/web/app/graphql/mutations/access/enable_biometrics.rb:4:in `<class:EnableBiometrics>'
/Users/amnesthesia/Dev/web/app/graphql/mutations/access/enable_biometrics.rb:2:in `<module:Access>'
/Users/amnesthesia/Dev/web/app/graphql/mutations/access/enable_biometrics.rb:1:in `<top (required)>'
<internal:/Users/amnesthesia/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/Users/amnesthesia/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:30:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/Users/amnesthesia/Dev/web/app/graphql/types/mutation_type.rb:4:in `<class:MutationType>'
/Users/amnesthesia/Dev/web/app/graphql/types/mutation_type.rb:2:in `<module:Types>'
/Users/amnesthesia/Dev/web/app/graphql/types/mutation_type.rb:1:in `<top (required)>'
<internal:/Users/amnesthesia/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/Users/amnesthesia/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:30:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/Users/amnesthesia/Dev/web/app/graphql/zavy360_schema.rb:13:in `<class:Zavy360Schema>'
/Users/amnesthesia/Dev/web/app/graphql/zavy360_schema.rb:1:in `<top (required)>'
<internal:/Users/amnesthesia/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/Users/amnesthesia/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:30:in `require'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/Users/amnesthesia/Dev/web/app/controllers/graphql_controller.rb:56:in `execute'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/actionpack-7.1.1/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/actionpack-7.1.1/lib/abstract_controller/base.rb:224:in `process_action'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/actionpack-7.1.1/lib/action_controller/metal/rendering.rb:165:in `process_action'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/actionpack-7.1.1/lib/abstract_controller/callbacks.rb:259:in `block in process_action'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activesupport-7.1.1/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
/Users/amnesthesia/Dev/web/app/controllers/application_controller.rb:89:in `block in set_logging_tags'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/semantic_logger-4.14.0/lib/semantic_logger/base.rb:190:in `block in tagged'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/semantic_logger-4.14.0/lib/semantic_logger/semantic_logger.rb:395:in `named_tagged'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/semantic_logger-4.14.0/lib/semantic_logger/base.rb:197:in `tagged'
/Users/amnesthesia/Dev/web/app/controllers/application_controller.rb:80:in `set_logging_tags'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activesupport-7.1.1/lib/active_support/callbacks.rb:130:in `block in run_callbacks'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/react-rails-3.1.1/lib/react/rails/controller_lifecycle.rb:33:in `use_react_component_helper'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activesupport-7.1.1/lib/active_support/callbacks.rb:130:in `block in run_callbacks'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activesupport-7.1.1/lib/active_support/callbacks.rb:141:in `run_callbacks'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/actionpack-7.1.1/lib/abstract_controller/callbacks.rb:258:in `process_action'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/actionpack-7.1.1/lib/action_controller/metal/rescue.rb:25:in `process_action'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/actionpack-7.1.1/lib/action_controller/metal/instrumentation.rb:74:in `block in process_action'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activesupport-7.1.1/lib/active_support/notifications.rb:206:in `block in instrument'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activesupport-7.1.1/lib/active_support/notifications/instrumenter.rb:58:in `instrument'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activesupport-7.1.1/lib/active_support/notifications.rb:206:in `instrument'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/actionpack-7.1.1/lib/action_controller/metal/instrumentation.rb:73:in `process_action'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/actionpack-7.1.1/lib/action_controller/metal/params_wrapper.rb:261:in `process_action'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/railties/controller_runtime.rb:32:in `process_action'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/actionpack-7.1.1/lib/abstract_controller/base.rb:160:in `process'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/actionview-7.1.1/lib/action_view/rendering.rb:40:in `process'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/actionpack-7.1.1/lib/action_controller/metal/live.rb:291:in `block (2 levels) in process'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activesupport-7.1.1/lib/active_support/concurrency/share_lock.rb:162:in `sharing'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/activesupport-7.1.1/lib/active_support/dependencies/interlock.rb:37:in `running'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/actionpack-7.1.1/lib/action_controller/metal/live.rb:282:in `block in process'
/Users/amnesthesia/.rvm/gems/ruby-3.2.2/gems/actionpack-7.1.1/lib/action_controller/metal/live.rb:368:in `block in new_controller_thread'

I'll try to find time to set up a full reproduction app but I'm pretty swamped at the moment unfortunately.

Important to note that this is resolved by changing this line in the initializer:

# lib/active_record/connection_adapters/abstract_adapter.rb Line 161
self.lock_thread = nil

to

# lib/active_record/connection_adapters/abstract_adapter.rb Line 161
self.lock_thread = Fiber

@rails-bot rails-bot bot removed the more-information-needed When reporter needs to provide more information label Nov 9, 2023
@fatkodima fatkodima added the more-information-needed When reporter needs to provide more information label Nov 9, 2023
@Amnesthesia
Copy link
Author

After further digging through the source code, I've found this can be solved in

setting:

config.active_support.isolation_level = :fiber

Seems the defaults may have changed here?

@rails-bot rails-bot bot removed the more-information-needed When reporter needs to provide more information label Nov 9, 2023
@matthewd
Copy link
Member

matthewd commented Nov 9, 2023

I believe Apartment does unsupported things with the Active Record API; it doesn't seem surprising that that would break in response to changing internals between AR versions. We'd need a reproduction using only published APIs to explore this further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants