Add connection retrying to ensure that the connection is automatically restored#2
Add connection retrying to ensure that the connection is automatically restored#2sdogruyol wants to merge 1 commit into
Conversation
…y restored when the database is gone.
shosti
left a comment
There was a problem hiding this comment.
I'm confused as to what the original problem was and why this fixes it. Why would doing 2 retries be better than 1 in this case? (One should have been enough...) Or is it just PGError vs PG::Error?
|
To validate that we don't create 2 transactions, I've used the following approach Created a The DummyJob would be something like PG has Adding a The enqueued QC job fails within this transaction then on the retry (which this PR adds) establishes a new connection with a new tx id. Note that This mean that we're safe regarding transactions 👍 About Seems like they're aliases, however while testing I've seen that |
|
I'm unsure as to whether this is actually testing what I'm worried about. What I'd like to see is something along the lines of: ActiveRecord::Base.transaction do
puts "ActiveRecord Transaction"
puts ActiveRecord::Base.connection.execute('select txid_current()').to_a
puts "QC Transaction"
puts QC.default_conn_adapter.connection.exec('select txid_current()').to_a
endafter the reconnect (during a request) and verifying that they are the same. |
No description provided.