]> Cypherpunks repositories - gostls13.git/commit
database/sql: Fix connection leak and potential deadlock
authorAlberto GarcĂ­a Hierro <alberto@garciahierro.com>
Wed, 16 Oct 2013 16:22:57 +0000 (09:22 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 16 Oct 2013 16:22:57 +0000 (09:22 -0700)
commit37db8804691f0a5e618cbc041909895c9709263c
treeb8e0c739848eec66cdc69f4636f15751370c191b
parent478f4b67543824c039d2f7afec6af88a59148db2
database/sql: Fix connection leak and potential deadlock

CL 10726044 introduced a race condition which causes connections
to be leaked under certain circumstances. If SetMaxOpenConns is
used, the application eventually deadlocks. Otherwise, the number
of open connections just keep growing indefinitely.

Fixes #6593

R=golang-dev, bradfitz, tad.glines, bketelsen
CC=golang-dev
https://golang.org/cl/14611045
src/pkg/database/sql/fakedb_test.go
src/pkg/database/sql/sql.go
src/pkg/database/sql/sql_test.go