-
Notifications
You must be signed in to change notification settings - Fork 49
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 locked error on create+migrate #311
Comments
It's a "race" condition I have yet to resolve. This has to do with how the connection pooling works. The process that held the sqlite connection open is shutting down at the same time a new one is spinning up and I have no way to reliably prevent that without dropping Is this a blocker for you or just an annoyance? |
Thanks for the quick response!
Annoyance and makes for a poor new user experience - I spent a lot of time triple-checking my config and narrowing down the root cause. Since this is a known issue, perhaps the error could be caught and a hint logged to console before re-raising? |
Another idea is to add a single sleep+retry to the migration function, with an opt-in repo config flag. |
That error is the process crashing. You would have to build that handler in your application. Curious, what is your pooling configuration for dev/test? |
This is a fresh Elixir app, all packages are up-to-date and all config is 100% defaults. The behavior should be reproducible with the code snippets in the first post. |
Set |
I'm going to leave this issue open until we complete the removal of |
Good idea. On ~50 runs in quick succession, this reduces the failure rate from ~30% to ~15%. For context, I ran into this while iterating on a new schema:
|
This is running locally (no virtualization, no remote filesystem) on MacOS. Why does Exqlite sometimes error when
drop/create/migrate
is run in quick succession? It looks likeecto.create
may be holding a write lock despite appearing to exit?The text was updated successfully, but these errors were encountered: