mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 16:33:37 +08:00
836ab73d59
A single SchemaCache instance is maintained by the connection pool, and made available via a schema_cache method on each connection. When the SchemaCache instance is fetched from the pool, its internal connection reference is updated to equal the requesting connection. However, since there is only one instance of SchemaCache, this internal connection reference is updated everywhere, and can ultimately result in multiple threads accessing the same database connection. In Discourse, this could result in Sidekiq jobs getting 'stuck' in database connections. This patch modifies SchemaCache so that it caches the internal connection on a per-thread basis Co-authored-by: Sam Saffron <sam.saffron@gmail.com> Co-authored-by: Matt Palmer <mpalmer@hezmatt.org> |
||
---|---|---|
.. | ||
active_record_attribute_methods.rb | ||
active_record_base.rb | ||
ams_include_without_root.rb | ||
better_handlebars_errors.rb | ||
fast_pluck.rb | ||
inflector_backport.rb | ||
match.rb | ||
open_uri_redirections.rb | ||
performance_fixes.rb | ||
pluck_first.rb | ||
postgresql_adapter.rb | ||
rack_patches.rb | ||
rails4.rb | ||
raw_handlebars.rb | ||
reaper.rb | ||
regexp.rb | ||
safe_buffer.rb | ||
safe_migrations.rb | ||
schema_cache_concurrency.rb | ||
schema_migration_details.rb | ||
sprockets_patches.rb | ||
translate_accelerator.rb | ||
zeitwerk.rb |