the code originally returns to conn pool when initialization has failed, but it has failed to consider the fact that during handshake() method and other methods, they all call conn.Close() which reclaims the connection back into the pool, and the extra return after initializing will cause a deadlock. the underlying problem is when c.createConn() fails, it does not reclaim the connection back into the pool which will cause the deadlock. thus this change will prevent deadlock when connect failed or handshake failed etc.
the code originally returns to conn pool when initialization has failed, but it has failed to consider the fact that during handshake() method and other methods, they all call conn.Close() which reclaims the connection back into the pool, and the extra return after initializing will cause a deadlock. the underlying problem is when c.createConn() fails, it does not reclaim the connection back into the pool which will cause the deadlock. thus this change will prevent deadlock when connect failed or handshake failed etc.