johnnadratowski / golang-neo4j-bolt-driver

Golang Bolt driver for Neo4j
MIT License
213 stars 72 forks source link

return the connection back into the pool even if the createConn fails… #49

Closed umsu2 closed 6 years ago

umsu2 commented 6 years ago

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.