Open PartlyAtomic opened 11 months ago
I suspect there may be other problems when tasks are cancelled, but haven't figured out minimal test cases for them yet. My program was often getting into a state where a series of cancelled write tasks would eventually lock the database indefinitely.
Description
When a task is cancelled while an aiosqlite.Connection object is connecting, the sqlite connection is never closed and is left hanging. Additionally the aiosqlite.Connection threads don't get shut down.
Details
Repro code:
Expected behavior: File handles for test.db would be released as tasks were successfully cancelled.
Actual behavior: 5 file handles are kept indefinitely for test.db (can be verified with a program such as OpenedFilesView or keeping track of the sqlite connections). Additionally after the event loop stops, the script hangs.