activerecord-cockroachdb-adapter icon indicating copy to clipboard operation
activerecord-cockroachdb-adapter copied to clipboard

fix: Refactor new connection

Open BuonOmo opened this issue 1 year ago • 3 comments

The old method was calling AbstractAdapter#initialize with a connection object, rather than a hash. This was then setting @unconfigured_connection, which in turns forced to re-run #configure_connection when a first query was made. This is usually OK (although unnecessary) except if use_follower_reads_for_type_introspection is used, since it sets AOST for a single query, which fails within a transaction.

Fixes #320

BuonOmo avatar Apr 09 '24 20:04 BuonOmo

This is great! Thanks for fixing!

dikshant avatar Apr 09 '24 20:04 dikshant

@BuonOmo when do you think this change will be released?

grantpaulson6 avatar Apr 10 '24 17:04 grantpaulson6

I don't know, it will depend on @rafiss' review. Besides that I think there's no issue

BuonOmo avatar Apr 10 '24 20:04 BuonOmo

just bumping this @rafiss @BuonOmo would love to see it sooner rather than later

grantpaulson6 avatar Apr 22 '24 20:04 grantpaulson6

@rafiss or @BuonOmo would you release this? We just had it happen in production and caused errors. It hosed a rails worker and we had to kill it

grantpaulson6 avatar May 03 '24 17:05 grantpaulson6

I still don't have the permissions to do it, I'll ping @rafiss

BuonOmo avatar May 03 '24 19:05 BuonOmo