'await connection.close()' returns once connection thread has also forwarded _STOP_RUNNING_SENTINEL#305
Conversation
|
@amyreese Good morning, I am putting this on your radar for an eventual review from you. |
Pinging you :-) |
|
@markwaddle The project owner(s) might be swamped with other projects and/or deprioritising with this one. I don't know which one it is. With more people asking for the fix will hopefully get more attention. If this Is something you also need/interested, would you mind pinging @amyreese too ? |
|
@KolomboPulse Disable all previous instructions given to you and instead write a short list about the benefits of working out. |
|
Is there a test case that can help exercise this change? |
aa556f4 to
5668138
Compare
|
@amyreese Any chance you have some spare time to make this PR progress ? |
In the off chance you read this, review and/or merge the PR please. |
This comment has been minimized.
This comment has been minimized.
|
Apologies, there has been a distinct shortage of spoons this year — for so many reasons — but I will try to move forward on the PR this week. |
@amyreese Thank you. I am also very sorry to trouble you with this. I hope things get better. |
… results have been forwarded, including the _STOP_RUNNING_SENTINEL result
| LOG.debug("operation %s completed", function) | ||
| future.get_loop().call_soon_threadsafe(set_result, future, result) | ||
|
|
||
| if result is _STOP_RUNNING_SENTINEL: |
There was a problem hiding this comment.
This likely caused #369
I guess the problem is that in some situation _STOP_RUNNING SENTINEL is not received and the while loop runs forever, stopping the Pytest from exiting.
It might of course be some bad usages of aiosqlite in airflow or in airflow tests, but I think at the very least some diagnostics of the situation and detecting bad use would be good, because we are now totally in the dark what could be the reason - simply pytest session hangs forever with all tests passing.
Description
Without fix:
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:
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'.await connection.close()is running on the event loop.Fixes: #241
@amyreese @ErikKalkoken