Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

database/sql: SetMaxOpenConns not effective #7798

Closed
gopherbot opened this issue Apr 16, 2014 · 7 comments
Closed

database/sql: SetMaxOpenConns not effective #7798

gopherbot opened this issue Apr 16, 2014 · 7 comments
Milestone

Comments

@gopherbot
Copy link

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.
@bradfitz
Copy link
Contributor

Comment 1:

Your program also consumes an infinite amount of memory in a loop, making new goroutines.
Can you fix that and verify you still see a problem?

Status changed to WaitingForReply.

@gopherbot
Copy link
Author

Comment 2 by andres.erbsen:

Yes, the problem is still present. http://play.golang.org/p/4RnxJhgNqE

@rsc
Copy link
Contributor

rsc commented May 21, 2014

Comment 3:

We seem to have dropped this one.

Labels changed: added release-go1.4.

Status changed to Accepted.

@gopherbot
Copy link
Author

Comment 4 by snoreven45:

This is pretty critical actually...

@bradfitz
Copy link
Contributor

Comment 6:

I think this was a duplicate of issue #7532 and fixed by revision a6cb2adc55eb.
Please confirm.

Labels changed: added repo-main.

Status changed to WaitingForReply.

@gopherbot
Copy link
Author

Comment 7 by andres.erbsen:

Works for me. Thanks.
go version go1.3beta2 +aecdc70c44ac Fri May 23 17:39:58 2014 -0700 linux/amd64
How I checked: http://play.golang.org/p/GuPNhxNLf7 runs in 200*0.05/4 = 2.5 seconds.

@bradfitz
Copy link
Contributor

Comment 8:

Good to hear, thanks for checking!

Status changed to Duplicate.

Merged into issue #7532.

@rsc rsc added this to the Go1.4 milestone Apr 14, 2015
@rsc rsc removed the release-go1.4 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants