rails: can't add a new key into hash during iteration lib/active_record/connection_adapters/abstract/query_cache.rb
Steps to reproduce
Since it is caching problem, it is tricky to reproduce
Expected behavior
No error
Actual behavior
backlog from the first case:
gems/activerecord-6.1.0.rc1/lib/active_record/connection_adapters/abstract/query_cache.rb:54:in `block in initialize': can't add a new key into hash during iteration (RuntimeError)
from gems/activerecord-6.1.0.rc1/lib/active_record/connection_adapters/abstract/query_cache.rb:111:in `block in cache_sql'
from gems/activesupport-6.1.0.rc1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
from gems/activesupport-6.1.0.rc1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
from gems/activesupport-6.1.0.rc1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
from gems/activesupport-6.1.0.rc1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
from gems/activesupport-6.1.0.rc1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
from gems/activerecord-6.1.0.rc1/lib/active_record/connection_adapters/abstract/query_cache.rb:109:in `cache_sql'
from gems/activerecord-6.1.0.rc1/lib/active_record/connection_adapters/abstract/query_cache.rb:101:in `select_all'
from gems/activerecord-6.1.0.rc1/lib/active_record/connection_adapters/mysql/database_statements.rb:12:in `select_all'
from gems/activerecord-6.1.0.rc1/lib/active_record/relation/calculations.rb:200:in `block in pluck'
from gems/activerecord-6.1.0.rc1/lib/active_record/relation.rb:868:in `skip_query_cache_if_necessary'
from gems/activerecord-6.1.0.rc1/lib/active_record/relation/calculations.rb:196:in `pluck'
yet another one:
gems/activerecord-6.1.0.rc1/lib/active_record/connection_adapters/abstract/query_cache.rb:54:in `block in initialize': can't add a new key into hash during iteration (RuntimeError)
from gems/activerecord-6.1.0.rc1/lib/active_record/connection_adapters/abstract/query_cache.rb:111:in `block in cache_sql'
from gems/activesupport-6.1.0.rc1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
from gems/activesupport-6.1.0.rc1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
from gems/activesupport-6.1.0.rc1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
from gems/activesupport-6.1.0.rc1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
from gems/activesupport-6.1.0.rc1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
from gems/activerecord-6.1.0.rc1/lib/active_record/connection_adapters/abstract/query_cache.rb:109:in `cache_sql'
from gems/activerecord-6.1.0.rc1/lib/active_record/connection_adapters/abstract/query_cache.rb:101:in `select_all'
from gems/activerecord-6.1.0.rc1/lib/active_record/connection_adapters/mysql/database_statements.rb:12:in `select_all'
from gems/activerecord-6.1.0.rc1/lib/active_record/querying.rb:47:in `find_by_sql'
from gems/activerecord-6.1.0.rc1/lib/active_record/statement_cache.rb:150:in `execute'
from gems/activerecord-6.1.0.rc1/lib/active_record/associations/association.rb:227:in `find_target'
from gems/activerecord-6.1.0.rc1/lib/active_record/associations/collection_association.rb:274:in `load_target'
from gems/activerecord-6.1.0.rc1/lib/active_record/associations/collection_proxy.rb:43:in `load_target'
from gems/activerecord-6.1.0.rc1/lib/active_record/associations/collection_proxy.rb:1002:in `records'
from gems/activerecord-6.1.0.rc1/lib/active_record/relation/delegation.rb:88:in `each'
System configuration
Rails version: 6.1.0.rc1
Ruby version: 2.5.8
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 21 (3 by maintainers)
@boof hey I’m the maintainer of
sentry-ruby
. would you mind opening an issue in the SDK repo with more details and I’ll help you investigate the problem?