aiosqlite
aiosqlite copied to clipboard
'await connection.close()' returns once connection thread has also forwarded _STOP_RUNNING_SENTINEL
trafficstars
Description
Without fix:
- Once
await connection.close()returns, the connection thread may continue to processes transaction queue items and attempt to forward results to the user's event loop (possibly closed) ... EVEN IF logically from the user POV the connection is closed.
With the fix:
- Once
await connection.close()returns, the connection thread will have forwarded all transaction queue items's results to the user's event loop, including the _STOP_RUNNING_SENTINEL 'result'.- The user's event loop cannot be closed while
await connection.close()is running on the event loop.
- The user's event loop cannot be closed while
Fixes: #241
@amyreese @ErikKalkoken