-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
sqlite misses database updates when program closes shortly afterwards #1760
Comments
This may be related to the use of This demo version does not use SqlitePool . This simplifies the code a little but had no effect on the symptom.
|
It's not This was a design decision we made early on as polling for a second row if the query wasn't limited would make the operation take basically twice as long as it should, but that was more for client/server database like Postgres where the server pushes rows to us as it fetches them. The worker does reset the statement when it's done which should make sure the results are committed, but without that If you end your program with |
Thank you. That makes sense and yes, adding the Even with the close(), the "-shm" file remains in place. Is that anything to be concerned about? |
Because this is async land we can't do blocking drops like the I/O handles in It's really just something you need to be aware of. As for the |
Darn. Well, thank you for thinking about it and for responding. |
This may be the same issue as : SQLite backend does not close database (which was closed 2 years ago).
This program adds an item to the database and then either exits or sleeps a little and then exits. If the sleep happens then the database gets properly inserted into but with no sleep, the insert does not seem to happen. Use command line option "-s" to choose to sleep. This seems to be most reproducible on linux but I saw it happen on windows as well. Also -wal and -shm files remain after the program runs ( is that a problem? ).
Below is a transcript. Note that with the -s option, new records get inserted but that stops happening without the -s
I'm using sqlx 0.5.11 .
Here's my Cargo.toml
And here's a repo with the bug demo: https://github.com/dc25/sqlx_bug_demo
The text was updated successfully, but these errors were encountered: