Skip to content

database/sql: SetMaxOpenConns not effective #7798

@gopherbot

Description

@gopherbot

by andres.erbsen:

Thanks.

What does 'go version' print?

go version go1.2.1 linux/amd64; postgresql 9.3+146really9.1+148 on Ubuntu
go version devel +93ad232384f8 Fri Apr 11 10:11:21 2014 -0700 linux/amd64
c; postgresql 9.3.4-1 on Arch Linux
go version devel +877b2382424b Wed Apr 16 14:36:44 2014 -0700 linux/amd64; postgresql
9.3.4-1 on Arch Linux

What steps reproduce the problem?

Run http://play.golang.org/p/_o6E3COOIZ with suitable database config
 
What happened?

panic: dial tcp 127.0.0.1:5432: too many open files
OR
panic: pq: remaining connection slots are reserved for non-replication superuser

What should have happened instead?

Each db.Query should have blocked until the previous one has finished, resulting in an
infinite loop creating many many idle goroutines.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions