-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
The app runs out of file descriptors when using prepared statements #41
Comments
I got following result.
Are you using gccgo? |
Using 8g, Fedora 17, 32 bits. Using the sqlite3.7.11-3.fc17 package. My results look something like this (after introducing a time.Sleep of 20 Milliseconds to obtain more measurements): 3
3
3
3
5
5
11
16
21
27
32
37
43
49
.........more results here....
981
987
993
999
1004
1010
1016
1021 // here the program fails
0
0
0 Let me know if I can provide some more information to debug the issue. |
Hmm, do you using latest version of go & sqlite3-devel? I tried above on CentOS6 32bit. |
Go installed from source: SQLite3 is the latest version Fedora has (3.7.11), but not the current one (3.7.15.2). I was about to try the same example using C, to see if it happens there too. |
I've tested a similar example ported to C with the functions you use and no leak of descriptors. Then I downgraded my Go version to 1, ( Have you some distribution of Go around to test if it is a regression? |
I've tested on tip. CentOS6
|
I've used hg bisect to find the change that starts reproducing the error. This one fails for me: https://code.google.com/p/go/source/detail?r=ddb9e6365e57 I'll investigate further |
Could you please file this issue to https://code.google.com/p/go/issues/list ? |
Thank you. |
Thank you. |
I've adapted the main.go file of the example to show my error:
https://gist.github.com/ernestokarim/5033404
In the iteration 1021 the app returns an
unable to open database file
error. Running this in another terminal tab (that's the reason of the initial sleep, to find the correct PID):reveals the number of open file descriptors is increasing all the time, even if I'm closing correctly the prepared statements.
Using a solution taken from other unrelated issue (#39 (comment)) I was able to keep the number of open files around 4 / 5 (in a comment, in the gist)
Is this a known behaviour of the library? Or are we leaking descriptors? There is a better solution to it?
The text was updated successfully, but these errors were encountered: