Sometimes, the connection can fail on the connect stage due to some unexpected error (e.g., network error. Example stack trace: https://pastila.nl/?00413e13/61b1dde4391c8ca6c33e13c77b81d916#C8Y5TPqFSMYzm1jCC7aj7A==). In that case, the connection will be returned to the connection pool in a "broken" state, and all queries with this connection will fail with the records have not fetched error.
Sometimes, the connection can fail on the
connect
stage due to some unexpected error (e.g., network error. Example stack trace: https://pastila.nl/?00413e13/61b1dde4391c8ca6c33e13c77b81d916#C8Y5TPqFSMYzm1jCC7aj7A==). In that case, the connection will be returned to the connection pool in a "broken" state, and all queries with this connection will fail with therecords have not fetched
error.This PR should fix this problem.