python-trio / trio-asyncio

a re-implementation of the asyncio mainloop on top of Trio
Other
187 stars 37 forks source link

TrioExecutor double-acquires the limiter, which can deadlock #143

Closed oremanj closed 2 months ago

oremanj commented 4 months ago

It makes its own acquire() call and then calls to_thread.run_sync which will acquire() again. If many tasks are submitted to the executor near-simultaneously, then they might all complete the first acquire() and then all block waiting for the second one to succeed, producing deadlock.