You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could we had a mecanism to detect a connection issue and to reset the connection? Maybe wrapping the thrown socket Errno as PQ::SocketError and adding PQ::Connection#reset and PG::Connection#reset methods?
This is useful when a connection gets staled or broken, which happens regularly on the Heroku free plans. I used to catch PG::Error exceptions, call LibPQ.reset once before retrying, as long as the reset didn't fail. Namely those two patches: ysbaddaden/frost@184642c and ysbaddaden/frost@b3c1586
The text was updated successfully, but these errors were encountered:
Adding those methods and wrapping does sound like a good solution. Is there a particular Errno that you see when the connection is dropped? I'll get to this sometime soon, but would accept a patch from anyone that wants to do this.
Related, it would also be possible to try to reconnect in the driver itself, but we wouldn't want to spin trying to reconnect forever. Maybe either one retry or exponential backoff. Not sure if that belongs in the driver or not though.
Could we had a mecanism to detect a connection issue and to reset the connection? Maybe wrapping the thrown socket Errno as PQ::SocketError and adding
PQ::Connection#reset
andPG::Connection#reset
methods?This is useful when a connection gets staled or broken, which happens regularly on the Heroku free plans. I used to catch
PG::Error
exceptions, callLibPQ.reset
once before retrying, as long as the reset didn't fail. Namely those two patches: ysbaddaden/frost@184642c and ysbaddaden/frost@b3c1586The text was updated successfully, but these errors were encountered: