asynch
asynch copied to clipboard
Add connection validity check in acquire method
- A new asynchronous method
_check_conn
is added to check the validity of the connection. This method is used in theacquire
method to ensure only valid connections are acquired from the connection pool. - Change the condition in
initialize
method to checkfreesize
instead ofsize
.
This is a good idea. I'd make it opt-in though.
SQLAlchemy uses the pool_pre_ping
argument (default False) to enable this behaviour.
https://docs.sqlalchemy.org/en/20/core/pooling.html#disconnect-handling-pessimistic
Thanks! Please resolve conflicts first.
Thanks! Please resolve conflicts first.
@long2ice I have resolved all the conflicts. Please review this PR again. Thank you!
Thanks!