mobc connection pool #181
-
Hello.
Here is my setup, and I am running in rust version 1.78.0
Here is how I am using it:
I then store that Arc in a context that gets shared throughout my service. I guess my questions are:
If you need more info please let me know. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I have not seen this behavior yet, so I'm not sure where it's coming from. I cannot really say what's the best way to debug this. That written: You configure your pool to use |
Beta Was this translation helpful? Give feedback.
-
Ok, I did finally get around this issue and it was entirely a configuration issue on my end. I am going to use the work around you mentioned for now, and try to get a PR in to use the ping he suggested. |
Beta Was this translation helpful? Give feedback.
I have not seen this behavior yet, so I'm not sure where it's coming from. I cannot really say what's the best way to debug this.
That written: You configure your pool to use
RecyclingMethod::Fast
, which essentially skips a check whether the connection is still usable. You might want to prefer usingRecyclingMethod::Verified
(the default), which performs a check query before assuming that the connection still works. In your particular case it might be that the connection is just closed by the server or by any network interruption.RecyclingMethod::Verified
would detect this case and open a new connection instead.