aiosqlite icon indicating copy to clipboard operation
aiosqlite copied to clipboard

'await connection.close()' returns once connection thread has also forwarded _STOP_RUNNING_SENTINEL

Open davidandreoletti opened this issue 1 year ago • 7 comments
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.

Fixes: #241

@amyreese @ErikKalkoken

davidandreoletti avatar Aug 15 '24 15:08 davidandreoletti