Created
September 13, 2012 16:04
-
-
Save robrasmussen/3715360 to your computer and use it in GitHub Desktop.
Fix for thread-safety bug in ActiveRecord::ConnectionAdapters::ConnectionPool
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveRecord | |
module ConnectionAdapters | |
class ConnectionPool | |
def release_connection_with_synchronization(with_id = current_connection_id) | |
synchronize do | |
release_connection_without_synchronization(with_id) | |
end | |
end | |
alias_method_chain :release_connection, :synchronization | |
def clear_stale_cached_connections_with_synchronization! | |
synchronize do | |
clear_stale_cached_connections_without_synchronization! | |
end | |
end | |
alias_method_chain :clear_stale_cached_connections!, :synchronization | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment