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: The app runs out of file descriptors when using prepared statements #4935

Closed
ernestoalejo opened this issue Feb 28, 2013 · 4 comments
Milestone

Comments

@ernestoalejo
Copy link

@ernestoalejo ernestoalejo commented Feb 28, 2013

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.

Compile & run the code in:
  https://gist.github.com/ernestokarim/5033404

It cannot be reproduced in the playground because it needs sqlite3.


What is the expected output?

Run without bugs.


What do you see instead?

Using any revision after this one:
  https://code.google.com/p/go/source/detail?r=ddb9e6365e57

it starts to consume file descriptors without end, you can check it:
  while [ 1 ] ; do ls /proc/6559/fd | wc -l ; sleep 1; done

even if I'm closing the prepared statements correctly. In the iteration 1021 it fails
with "unable to open database file".


Which compiler are you using (5g, 6g, 8g, gccgo)?

8g.


Which operating system are you using?

Fedora 17, 32 bits. SQLite3, the latest version from the website.


Which version are you using?  (run 'go version')

go version devel +c0258d9a3589 Wed Feb 27 15:22:14 2013 -0800 linux/386


Please provide any additional information below.

mattn/go-sqlite3#41
@julienschmidt
Copy link
Contributor

@julienschmidt julienschmidt commented Feb 28, 2013

Comment 1:

Duplicate of #4902 ?
@julienschmidt
Copy link
Contributor

@julienschmidt julienschmidt commented Feb 28, 2013

Comment 2:

Duplicate of https://golang.org/issue/4902 ?
@ernestoalejo
Copy link
Author

@ernestoalejo ernestoalejo commented Feb 28, 2013

Comment 3:

I didn't read the issue to the end because the title said "Exec", not Prepare() /
Close(); but it seems like it's somewhat related, the statements are not released
correctly either in 4902.
@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Mar 8, 2013

Comment 4:

Status changed to Duplicate.

Merged into issue #4902.

@mikioh mikioh changed the title The app runs out of file descriptors when using prepared statements in database/sql database/sql: The app runs out of file descriptors when using prepared statements Feb 18, 2015
@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1maybe label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.