-
Hello, I am using pgxpool v5 as a connection pool. I am not sure what I am doing is the right way to do things (please let me know if you can see a better way), but I have created a health check method in my DB code and that calls In my manual testing, I started a Pg server, connected a pool to it using What should I be doing here? Questions I have are:
Thanks for your help and I appreciate all of the work on this library. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
If the connection is open as far as the client is concerned, then it may wait until the underlying net.Conn realizes it is dead. You may want to pass Ping a context with a deadline to handle broken connections. |
Beta Was this translation helpful? Give feedback.
-
Thanks, that is helpful. And FWIW, I found out that the reason I ran into this issue at all is because I was using Pg via Docker, and I used |
Beta Was this translation helpful? Give feedback.
If the connection is open as far as the client is concerned, then it may wait until the underlying net.Conn realizes it is dead. You may want to pass Ping a context with a deadline to handle broken connections.