pennylane-hq / activerecord-adapter-redshift

Other
6 stars 27 forks source link

Why adapter is not using with_raw_connection in 7.1 variant #16

Closed JakubOboza closed 5 months ago

JakubOboza commented 7 months ago

Rails 7.1 introduced new approach to syncing.

I found that connections now can get stale in long running workers like sidekiq and adapter will not automagically reconnect just serve stale connection (You start getting ssl connection exceptions etc and PG::ConnectionBad, PG::UnableToSend ).

Is there any reason to not use with_raw_connection for things like query that wraps async_exec ????

quentindemetz commented 5 months ago

Hi @JakubOboza - there is no good reason to be using with_raw_connection. Generally we want to mirror as much as possible what is happening in the PG adapter. Feel free to open a PR

JakubOboza commented 5 months ago

My question was from 2 Feb but You kinda did introduce with_raw_connection at the end of Feb (29 Feb) in this commit. It looks good now. You can close this one.

https://github.com/pennylane-hq/activerecord-adapter-redshift/commit/2b5e9b0fa1836849a078bf638a7cf2fbe225dab1