How to make auto reconnect or retry execution? #2245
Replies: 2 comments 8 replies
-
I also understand that connection_validator will not help me in the situation if, for example, connection to the pool was established 20 minutes ago, then I execute a query => I get Sequel::DatabaseDisconnectError and will continue to get it until another 10 minutes pass and connection_validator works to recheck connections? |
Beta Was this translation helpful? Give feedback.
-
@jeremyevans I searched the questions and couldn't find anything similar, except for the recommendation using -1, but that doesn't work in my case, nor does rechecking connections frequently, since this error occurs rarely during the day, and checking connections frequently will affect performance in terms of response latency. I look forward to your help 🙏 |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm having my application crash at some point with “Sequel::DatabaseDisconnectError”, I couldn't find is there any option here to do a retry for the query? I already use connection_validator once every 30 minutes but I don't want to use it before every connection with option (-1), is there any mechanism when Sequel::DatabaseDisconnectError make a new connection and execute the query and try it say 4 times if not then throw the error?
I also understand that connection_validator will not help me in the situation if, for example, connection to the pool was established 20 minutes ago, then I execute a query => I get Sequel::DatabaseDisconnectError and will continue to get it until another 10 minutes pass and connection_validator works to recheck connections?
Update: I use pgbouncer (I can't give it up because it's forbidden in cloud service)
Beta Was this translation helpful? Give feedback.
All reactions