-
Notifications
You must be signed in to change notification settings - Fork 67
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
Deadlock in wait_for_unlock_notify after SQLITE_BUSY #6
Comments
Here's the sequence of events: a few SQLITE_BUSY, then a few SQLITE_DONE, then a SQLITE_LOCKED that deadlocks on pthread_cond_wait. All this happens on the same goroutine, but with a new Pool.Get for each query (as you can see from the PRAGMA query bound to Get).
I can't reproduce it with a pool size of 1, everything keeps working fine after the SQLITE_BUSY. |
Ouch, thanks. I'll take a look at this tomorrow. One possibility is that I'm being too imprecise on error matching. Right now the code uses That would be easy to fix, look for the extended error code |
It might be relevant that this is a WAL database. |
I had some trouble replicating this when I tried last week (but forgot to update the issue). What OS are you using? |
This is on macOS.
|
I ran into a similar issue on Ubuntu 16.04, with both |
Saw this too with a pool of size 2, also having a hard time coming up with a reproducible test case, but I'll attempt to post one as soon as I figure out the conditions. edit: here's my stacktrace:
This is with a pool of size 2, default options. Every other query (on the other conn presumably?) returns |
Merging #25 closed this issue, but @FiloSottile may want to check if the original issue cannot still be reproduced. |
I have a program accessing a db with a Pool, and during its operation I lock the database from another process. A couple SQLITE_BUSY errors are returned. Shortly after (but not immediately, like after 3 queries), the library deadlocks in
wait_for_unlock_notify
. It's very reproducible.This is from a SIGQUIT:
(I think) I am using Pool in a fairly straightforward way, and most of the work is done by a single main goroutine. The code is at https://github.com/FiloSottile/mostly-harmless/tree/4a6ff25/covfefe
The text was updated successfully, but these errors were encountered: