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: Sqlite database locks up when using database/sql across multiple go routines. #2887

Closed
gopherbot opened this issue Feb 6, 2012 · 5 comments

Comments

@gopherbot
Copy link

by krolaw:

What steps will reproduce the problem?
1. Build and run http://pastebin.com/CymKMXja  (io/signal -> exp/signal for default)
2. Open in web browser http://127.0.0.1:7777
3. Click "Again" submit button multiple times in quick succession.

What is the expected output?
The form continuing to appear with running total.

What do you see instead?
No data Received error in browser.
On command line:
2012/02/06 22:55:09 http: panic serving 127.0.0.1:38887: database is locked

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

Which operating system are you using?
Ubuntu 11.10

Which revision are you using?  (hg identify)
7c35ab6ef473 tip

Please provide any additional information below.
Problem doesn't seem to appear with sleep removed, yet should not make a difference as
DB should not be locked whilst goroutine is sleeping.
Also, once DB locks, it is only freed on quitting the program.
Lastly, I've never had it write lock, only read lock.
@gopherbot
Copy link
Author

Comment 1 by krolaw:

Oh, and this only occurs with Prepared stmts.  DB.Exec/Query works fine.

@bradfitz
Copy link
Contributor

Comment 2:

Labels changed: added priority-go1, removed priority-triage.

Owner changed to @bradfitz.

Status changed to Accepted.

@bradfitz
Copy link
Contributor

Comment 4:

Yes, it appears that the sqlite driver has a bug.
I've reproduced it in the test suite here:
bradfitz/go-sql-test@16c8f24
Postgres and MySQL work fine.
I'll look into this if it's easy, but otherwise I think it's a bug for mattn (copied).

@bradfitz
Copy link
Contributor

Comment 5:

Labels changed: added priority-later, removed priority-go1.

@bradfitz
Copy link
Contributor

Comment 6:

I recall that this was fixed.

Status changed to Fixed.

@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
Development

No branches or pull requests

2 participants